Open receiver1 opened 7 months ago
I think virtual host with http(s)
scheme should work.
Custom protocols seem a bit broken for many things.
So far my experience with custom schemes is that WebResourceRequested never fires, you get a not authorized error in the console. Only NavigationStarted/Ended fire.
I ran into a this issue as well. To resolve it, I had to add a WebResourceResponseReceived handler (add_WebResourceResponseReceived). Simply returning S_OK from the handler and my WebResourceRequested started receiving calls for the 401 files.
Thanks, i'll try it
What happened?
Hello! I'm developing Embedded Desktop Application using webview2 like GUI. I want statically link resources, so I registered a custom URI scheme and add WebResourceRequested handler. I ran into a problem that loading resources in CSS does not trigger this event.
My CSS:
My WebResourceRequested handler: (cut down version)
My scheme registration code:
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
No response
SDK Version
No response
Framework
Win32
Operating System
Windows 10
OS Version
No response
Repro steps
The behavior I expect is for the WebResourceRequested event to be raised when using a custom schema in CSS. The current behavior outputs to me in the developer console:
Failed to load resource: the server responded with a status of 401 (Unauthorized)
and when refreshing the pageGET res://consolasbold.woff2/ net::ERR_ABORTED 401 (Unauthorized)
Moreover, if you make the same request through the Fetch API in JavaScript, the resource is perfectly defined and obtained. The only difference between these two requests that I found is the presence of "Origin: null" in the headers on the CSS side of the requestrequest made by CSS: (does not raise the WebResourceRequested event)
request executed JS: (raises the WebResourceRequested event)
![image](https://github.com/MicrosoftEdge/WebView2Feedback/assets/62743649/a11a7c91-73a7-403f-b5e0-878390f5c69d)
Repros in Edge Browser
No
Regression
No, this never worked
Last working version (if regression)
No response