Skip to content
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

CoreWebView2NewWindowRequestedEventArgs.Handled does not prevent new window #549

Closed
dimmelsw opened this issue Oct 20, 2020 · 6 comments
Closed
Labels
bug Something isn't working tracked We are tracking this work internally.

Comments

@dimmelsw
Copy link

dimmelsw commented Oct 20, 2020

Description
CoreWebView2NewWindowRequestedEventArgs.Handled does not prevent new window.

Version
SDK: 1.0.674-prerelease
Runtime: 86.0.622.48
Framework: WinForm
OS: Win10

Repro Steps
Handle coreWebView2.NewWindowRequested-Event
Set CoreWebView2NewWindowRequestedEventArgs.Handled to true

private void CoreWebView2_NewWindowRequested(object sender, CoreWebView2NewWindowRequestedEventArgs e)
{
	e.Handled = true;
}

I expect WebView2 not to open a new window.
Instead I want to open a custom window.

Additional context
It worked as expected in 0.9.579-prerelease

AB#29899723

@dimmelsw dimmelsw added the bug Something isn't working label Oct 20, 2020
@champnic
Copy link
Member

Thanks for reporting this. I've opened a bug on our end and we'll take a look. Thanks!

@champnic champnic added the tracked We are tracking this work internally. label Oct 20, 2020
@ronschmidt55
Copy link

I have found this to be an issue as well. e.handled does not work anymore. Also, if I let webview2 handle the popup (e.handled = false), the popup does not size itself to the window.open sizes specified. Also, if I handle the new window (e.handled = True) and open my own window, that works fine, but if I set e.NewWindow to the window I opened and then popup another new window, it opens a 2nd window instead of reusing the one already opened.

@pagoe-msft
Copy link

Hi Everyone,

This was addressed in the 1.0.664.37 version.

@ronschmidt55
Copy link

Hi. I went and got Webview2 version 1.0.707-prerelease to test this out. With this version I cannot get the Webview2 to initialize. Keep getting 'Object reference not set to an instance of an object'. I have tried many things, but cannot resolve the issue.

@champnic
Copy link
Member

champnic commented Dec 1, 2020

@ronschmidt55 Could you see if you are running into #678?

@ronschmidt55
Copy link

Yes, same issue. Version 1.0.721-prerelease fixed the issues. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tracked We are tracking this work internally.
Projects
None yet
Development

No branches or pull requests

4 participants