WebView2Feedback icon indicating copy to clipboard operation
WebView2Feedback copied to clipboard

[Problem/Bug]: NavigateToString does not request CoreWebView2BasicAuthenticationRequestedEventArgs

Open leonidukg opened this issue 2 months ago • 1 comments

What happened?

We have a proxy connection, but authorization is triggered only if the navigation was to an external source. If we make a code:

Webview2.CoreWebView2.NavigateToString("<html><body>IMG: <img src='https://www.google.com/tia/tia.png'></body></html>");

Then we have a 407 error in devtool, but there is no request to the proxy in automatic mode and the CoreWebView2BasicAuthenticationRequestedEventArgs function is not called in any way.

It's too dangerous to use crutches with authorization first to .Navigate("https://google.com"), and then to perform NavigateToString, and there may be pitfalls.

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

No response

SDK Version

No response

Framework

WPF

Operating System

Windows 11

OS Version

No response

Repro steps

Standard authorization code: https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.basicauthenticationrequested?view=webview2-dotnet-1.0.3537.50

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

leonidukg avatar Oct 10 '25 10:10 leonidukg

I also want to add here that proxy authorization also does not work if ServiceWorker requests it, you can test it on the website: https://scrapbox.io/

leonidukg avatar Oct 21 '25 07:10 leonidukg