diff --git a/lib/pages/webview/webview_page.dart b/lib/pages/webview/webview_page.dart index 4f5492409..da42ded89 100644 --- a/lib/pages/webview/webview_page.dart +++ b/lib/pages/webview/webview_page.dart @@ -189,21 +189,21 @@ class _WebviewPageNewState extends State { _webViewController?.addJavaScriptHandler( handlerName: 'finishButtonClicked', callback: (args) { - _webViewController?.evaluateJavascript(source: """ - Array.from(document.querySelectorAll('.ql-editor > p')).map(p => p.textContent).join('\\n'); -""").then((value) { - // try { - // String? summary = (value as String?); - // if (summary?.isNotEmpty == true) { - // VideoHttp.addNote( - // oid: widget.oid!, - // title: widget.title!, - // summary: summary!, - // ); - // } - // } catch (_) {} - Get.back(); - }); + Get.back(); +// _webViewController?.evaluateJavascript(source: """ +// Array.from(document.querySelectorAll('.ql-editor > p')).map(p => p.textContent).join('\\n'); +// """).then((value) { + // try { + // String? summary = (value as String?); + // if (summary?.isNotEmpty == true) { + // VideoHttp.addNote( + // oid: widget.oid!, + // title: widget.title!, + // summary: summary!, + // ); + // } + // } catch (_) {} + // }); }, ); _webViewController?.addJavaScriptHandler( @@ -294,6 +294,14 @@ class _WebviewPageNewState extends State { _progressStream.add(1); } : null, + shouldInterceptRequest: (controller, request) async { + String url = request.url.toString(); + if (url.startsWith( + 'https://passport.bilibili.com/x/passport-login/web')) { + return WebResourceResponse(); + } + return null; + }, shouldOverrideUrlLoading: (controller, navigationAction) async { if (_inApp == true) { return NavigationActionPolicy.ALLOW;