Upstream source code synchronization

This commit is contained in:
2026-05-28 22:08:12 +08:00
parent fb5fd6c9bc
commit 81864c99c2
13 changed files with 470 additions and 22 deletions
@@ -1442,8 +1442,12 @@ class _OfficialDownloadDesktopWebViewState
domStorageEnabled: true,
supportZoom: false,
transparentBackground: true,
isInspectable: true,
cacheMode: desktop.CacheMode.LOAD_DEFAULT,
supportMultipleWindows: false,
useShouldOverrideUrlLoading: true,
useOnDownloadStart: true,
useHybridComposition: true,
),
onWebViewCreated: (controller) {
_controller = controller;
@@ -1457,6 +1461,18 @@ class _OfficialDownloadDesktopWebViewState
);
},
onLoadStop: (_, url) => _installHook(),
shouldInterceptRequest: (_, request) async {
final url = request.url.toString();
if (widget.onNavigationUrl(url)) {
return null;
}
return null;
},
onLoadStart: (_, url) {
if (url != null) {
widget.onNavigationUrl(url.toString());
}
},
shouldOverrideUrlLoading: (_, action) {
final url = action.request.url?.toString();
if (url != null && widget.onNavigationUrl(url)) {