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
[Bug]: Problems with webview new-window event #35417
Comments
The new-window event is deprecated. You can use contents.setWindowOpenHandler(handler) instead which gives you more control over the handling. |
@Kilian this api is not for webview tag |
That doesn't matter - the event is still deprecated and going away. You should, as kilian said, use |
If I use
As I understand it, this should allow the window to open. But it doesn't. I don't get the pop-up window, and the link opens in the existing |
@toschlog How to access |
Like this:
|
Thanks |
@Kilian @codebytere Anything on |
FYI the |
Preflight Checklist
Electron Version
20.0.0
What operating system are you using?
Windows
Operating System Version
Windows 10 Home 19042.1826
What arch are you using?
x64
Last Known Working Electron version
No response
Expected Behavior
When the page displayed in a webview attempts to open a new tab, I would expect to get the new-window event and be able to open a new webview myself.
Actual Behavior
I do not get the new-window event when the web page attempts to open the new tab. However, if I specify
allowpopups='true'
on my webview, I do get the event. But in this case Electron opens a new BrowserWindow and there's apparently nothing I can do to stop it.Testcase Gist URL
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: