最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

C# webview2 can’t loading popup page - Stack Overflow

programmeradmin0浏览0评论

I’m implementing a specific authentication flow using WebView2. When clicking on an HTML element on a specific domain, a new window opens, sends a session authentication request to another domain, and then redirects to a new URL. However, I’m facing an issue when trying to handle this process in WebView2.

Current Situation:

When clicking a button on a specific domain, a popup window opens. The popup window undergoes the following process: Initial URL: about:blank (blank page) Then redirects: Authentication domain → Final target domain. I attempted to handle the popup in a new WebView2 instance using the NewWindowRequested event. The issue is that when I set e.Handled = true to block the popup, and then try to load the URL in a new WebView2 instance, it stops at about:blank and doesn’t proceed with the redirection.

Issues:

The initial URL of the popup is always about:blank, and the redirection doesn’t proceed. When I set e.Handled = false to unblock the popup, the popup opens in the default Edge browser, and the authentication and redirection process works as expected. However, in the new WebView2 control, the process gets stuck at about:blank, and the redirection does not occur. Let me know if you'd like to make further adjustments!

发布评论

评论列表(0)

  1. 暂无评论