Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

fix(windows): fix webview2 proxy

Predidit78c339989f4d
diff --git a/lib/pages/webview/webview_controller_impel/webview_windows_controller_impel.dart b/lib/pages/webview/webview_controller_impel/webview_windows_controller_impel.dart
index 299e1c13..2526b130 100644
--- a/lib/pages/webview/webview_controller_impel/webview_windows_controller_impel.dart
+++ b/lib/pages/webview/webview_controller_impel/webview_windows_controller_impel.dart
@@ -97,7 +97,15 @@ class WebviewWindowsItemControllerImpel
s.cancel();
} catch (_) {}
});
- webviewController!.dispose();
+ // It's a custom function to dispose the whole webview environment in Predidit's flutter-webview-windows fork.
+ // which allow re-initialization webview environment with different proxy settings.
+ // It's difficult to get a dispose finish callback from Microsoft Edge WebView2 SDK,
+ // so don't call webviewController.dispose() when we call WebviewController.disposeEnvironment(), WebViewController.disposeEnvironment() already do any necessary clean up internally.
+ // ohtherwise, app will crash due to resource conflict.
+ if (webviewController != null) {
+ WebviewController.disposeEnvironment();
+ webviewController = null;
+ }
}
// The webview_windows package does not have a method to unload the current page.
diff --git a/pubspec.lock b/pubspec.lock
index ac271ba2..14789032 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -1695,8 +1695,8 @@ packages:
dependency: "direct main"
description:
path: "."
- ref: "4399f68beab25d51b277e37e3949f9fb2d6d8304"
- resolved-ref: "4399f68beab25d51b277e37e3949f9fb2d6d8304"
+ ref: "9962cb9416f867d9ce9f409ccd6784e78c5f72ca"
+ resolved-ref: "9962cb9416f867d9ce9f409ccd6784e78c5f72ca"
url: "https://github.com/Predidit/flutter-webview-windows.git"
source: git
version: "0.4.0"
diff --git a/pubspec.yaml b/pubspec.yaml
index 53fdafea..cc9c464f 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -94,7 +94,7 @@ dependencies:
webview_windows:
git:
url: https://github.com/Predidit/flutter-webview-windows.git
- ref: 4399f68beab25d51b277e37e3949f9fb2d6d8304
+ ref: 9962cb9416f867d9ce9f409ccd6784e78c5f72ca
desktop_webview_window:
git:
url: https://github.com/Predidit/linux_webview_window.git