-
Notifications
You must be signed in to change notification settings - Fork 15.7k
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
feat: Allow creation of new window to be customizable. #41432
feat: Allow creation of new window to be customizable. #41432
Conversation
cd39cc1
to
e8c6988
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
Linux build failure is a known flaky test |
e8c6988
to
2af7bb0
Compare
Congrats on merging your first pull request! 🎉🎉🎉 |
Release Notes Persisted
|
@khalwa Sorry if I'm not understanding something, but how is this API supposed to work with WebContentsView (which is replacing BrowserView)? With a BrowserView, the
I get:
|
@PalmerAL Hi! This PR was started two years ago (see reference in description) when Edit:
|
@khalwa Thanks! That matches my investigation too. @nornagon Since it looks like you wrote the WebContentsView implementation and also reviewed this previously:
|
Description of Change
This PR adds a way to manually control the creation of a guest window in
webContents.setWindowOpenHandler
. My main motivation for this change is to have the possibility to properly handle new windows in form of BrowserView (in order to supportwindow.opener
I need to pass appropriateWebContents
when creating an instance of it).I am not an expert so I don't know what important things I could've missed introducing this change but I am hoping that with your guidance we'll be able to work on this PR and make such functionality possible in Electron.
This is a copy of #33134 but this time set up from my private fork.
Checklist
npm test
passesRelease Notes
Notes: Extended
webContents.setWindowOpenHandler
to support manual creation of BrowserWindow.