Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

shouldInterceptRequest doesn't work on Windows. #2442

Open
1 of 2 tasks
hpp0hpp opened this issue Dec 3, 2024 · 0 comments
Open
1 of 2 tasks

shouldInterceptRequest doesn't work on Windows. #2442

hpp0hpp opened this issue Dec 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@hpp0hpp
Copy link

hpp0hpp commented Dec 3, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

shouldInterceptRequest doesn't work on windows, only work on android

Expected Behavior

shouldInterceptRequest work on windows

Steps with code example to reproduce

   shouldInterceptRequest: (controller, request) {
      print(request.url);
      if (request.url.pathSegments.last.contains(RegExp(r'\.(m3u8|mp4|flv)'))) {
        // FLog.info(text: "解析到地址: ${request.toString()}");

        c.complete(request);
      }
      return Future.value(null);
    },

Stacktrace/Logs

Stacktrace/Logs
[WindowsInAppWebViewController] (windows) WebView ID 270201115424116187237851469825422023122225 calling "shouldOverrideUrlLoading" using {isForMainFrame: true, isRedirect: false, navigationType: null, request: {body: null, headers: {Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7, Upgrade-Insecure-Requests: 1, User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.62, sec-ch-ua: "Microsoft Edge";v="131", "Chromium";v="131", "Not_A Brand";v="24", "Microsoft Edge WebView2";v="131", sec-ch-ua-mobile: ?0, sec-ch-ua-platform: "Windows"}, method: GET, url: https://www.yangshipin.cn/live/detail?pid=600191750}}
flutter: WebResourceError{description: Indicates that the connection was stopped., type: CONNECTION_ABORTED}
[WindowsInAppWebViewController] (windows) WebView ID 270201115424116187237851469825422023122225 calling "onProgressChanged" using {progress: 100}
[WindowsInAppWebViewController] (windows) WebView ID 270201115424116187237851469825422023122225 calling "onReceivedError" using {error: {description: Indicates that the connection was stopped., type: 9}, request: {headers: {Upgrade-Insecure-Requests: 1, User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0, sec-ch-ua: "Microsoft Edge";v="131", "Chromium";v="131", "Not_A Brand";v="24", "Microsoft Edge WebView2";v="131", sec-ch-ua-mobile: ?0, sec-ch-ua-platform: "Windows"}, isForMainFrame: true, method: null, url: about:blank}}

Flutter version

3.24.1

Operating System, Device-specific and/or Tool

Windows

Plugin version

v6.1.5

Additional information

I think maybe because we didn't set the followings on windows. according to the stackflow https://stackoverflow.org.cn/questions/62416494

WebView2.CoreWebView2.AddWebResourceRequestedFilter("*", CoreWebView2WebResourceContext.All);

Self grab

  • I'm ready to work on this issue!
@hpp0hpp hpp0hpp added the bug Something isn't working label Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant