-
Notifications
You must be signed in to change notification settings - Fork 55
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
[Problem/Bug]: Race condition registering for WebResourceRequested events when handling NewWindowRequested #4181
Comments
@nishitha-burman, as discussed, this issue is causing widespread problems on websites and we'd very much appreciate some help on resolving it. Here are a few examples:
You can see the examples by trying the above use cases in our browser: duckduckgo.com/windows. |
@RendijsSmukulis @pdolanjski To intercept requests from iframes, use AddWebResourceRequestedFilter with CoreWebView2WebResourceRequestSourceKinds param which should be available in release package soon. And make sure to use the filter once the new window is set. I am currently investigating on race condition issue and will update the thread once I have a fix ready. |
@monica-ch thank you for investigating this! While the repro uses both AddWebResourceRequestedFilter and Chrome DevTools Protocol's Let us know if we can help with testing the fix in Canary or similar. |
Hi @monica-ch , have you had any luck with the investigation? |
Hi everyone, we fixed the issue to allow apps to run cdp messages by calling CallDevToolsProtocolMethod before new window is set in Edge Canary version 125.0.2505.0 and above.
Please validate and let us know if you have any questions. |
Thanks @monica-ch. We're working on validating against a number of examples, so we'll get back to you soon. |
We have tested the changes in our app and can confirm it is working as expected. |
What happened?
We found a timing problem similar to script injection, but this time with web resource request handling, and it can be reproduced both with the
WebResourceRequested
event and the Chromium DevTools ProtocolFetch.requestPaused
event.The essence of the issue is the following:
@gkerenyi has created a small repro app, please find it here with additional information in the readme: https://github.com/gkerenyi/CdpVsNewWindow
Either it should be possible to set up both types of event handlers before setting NewWindow, or navigation should not start until the deferral for NewWindowRequested is completed.
Since the WebResourceRequested event is lacking in functionality compared to CDP Fetch, we especially need the Fetch method to be guaranteed to be ready to process all web requests when starting navigation in a new window.
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime), Prerelease (Edge Canary/Dev/Beta)
Runtime Version
No response
SDK Version
No response
Framework
WPF
Operating System
Windows 10, Windows 11
OS Version
No response
Repro steps
See the repro app, please find it here with additional information in the readme: https://github.com/gkerenyi/CdpVsNewWindow
Repros in Edge Browser
Not Applicable
Regression
No, this never worked
Last working version (if regression)
No response
AB#47964385
The text was updated successfully, but these errors were encountered: