You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 page GET 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 request
request made by CSS: (does not raise the WebResourceRequested event)
request executed JS: (raises the WebResourceRequested event)
Repros in Edge Browser
No
Regression
No, this never worked
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered:
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.
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 request
request made by CSS: (does not raise the WebResourceRequested event)
![image](https://private-user-images.githubusercontent.com/62743649/303585934-6dfac40a-2280-40a2-9add-318c9cb8b8fc.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzOTQ1NDAsIm5iZiI6MTczOTM5NDI0MCwicGF0aCI6Ii82Mjc0MzY0OS8zMDM1ODU5MzQtNmRmYWM0MGEtMjI4MC00MGEyLTlhZGQtMzE4YzljYjhiOGZjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDIxMDQwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWZlZWI2YWUyMmFjZTIwOTYxNmFhM2MyNTdhNDgzYTNhZGIxM2NmNzUxMDcxMmUzMjQxNWNiZjEzNjhjZmY0OGEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.gI0j0IHQPgIjcDuaLFHBs5MThmK7hWRlZuzjN8nFtQM)
![image](https://private-user-images.githubusercontent.com/62743649/303586268-a11a7c91-73a7-403f-b5e0-878390f5c69d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzOTQ1NDAsIm5iZiI6MTczOTM5NDI0MCwicGF0aCI6Ii82Mjc0MzY0OS8zMDM1ODYyNjgtYTExYTdjOTEtNzNhNy00MDNmLWI1ZTAtODc4MzkwZjVjNjlkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEyVDIxMDQwMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAyNWNiY2U2YzhjZWUxNGNkMDhlM2YwYzJjNGM0MjJlNTBhNGI1ZjIwZTU2ZmJmYWY0NzAzODk2NzJmN2RmNWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ZdUA_rO6Q4A0xLVgQOQpdFjOJoMAIiVeEbG2p9d1Gu8)
request executed JS: (raises the WebResourceRequested event)
Repros in Edge Browser
No
Regression
No, this never worked
Last working version (if regression)
No response
The text was updated successfully, but these errors were encountered: