记录移动壳下载阻断事件

移动壳阻断 WebView 文件下载时记录宿主诊断日志

补充移动壳下载阻断日志测试

扩展移动壳配置门禁防止下载阻断静默回退
This commit is contained in:
2026-06-20 22:29:21 +08:00
parent 03849a5879
commit 69ff4af4e6
3 changed files with 38 additions and 1 deletions
@@ -1497,6 +1497,8 @@ for (const snippet of [
'source: window',
'MOBILE_WEBVIEW_BEFORE_CONTENT_SCRIPT',
'shouldBlockMobileWebViewNavigationRequest',
'logMobileShellDownloadBlocked',
"console.warn('mobile shell blocked WebView file download', event)",
'SafeAreaProvider',
'SafeAreaView',
'MOBILE_SHELL_SAFE_AREA_EDGES',
@@ -1515,6 +1517,7 @@ for (const snippet of [
'webviewDebuggingEnabled={false}',
'injectedJavaScriptBeforeContentLoaded={MOBILE_WEBVIEW_BEFORE_CONTENT_SCRIPT}',
'handleBlockedFileDownload',
'logMobileShellDownloadBlocked(event)',
'onFileDownload={handleBlockedFileDownload}',
'setSupportMultipleWindows={false}',
'logMobileShellNavigationFailure',
@@ -1530,6 +1533,10 @@ if (shellAppSource.includes('catch(() => undefined)')) {
throw new Error('mobile shell ShellApp must not hide async navigation failures');
}
if (!shellAppTestSource.includes('blocked WebView file downloads are logged for host diagnostics')) {
throw new Error('mobile shell tests must cover blocked WebView file download diagnostics');
}
for (const snippet of [
"describe('mobile shell safe area'",
"test('protects the WebView from every device edge'",