feat: add ability to configure if window should close when opener closes (#31314)
* feat: Added ability to configure if window should close when opener closes * fix: check if embedder is destroyed * fix: correctly take over closeWithOpener property * chore: Added documentation * Update docs/api/window-open.md Co-authored-by: John Kleinschmidt <jkleinsc@github.com> * chore: refactor Co-authored-by: Jeremy Rose <nornagon@nornagon.net> * chore: changed property name from `closeWithOpener` to `outlivesOpener` * dummy change to kick lint * undo above Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
This commit is contained in:
parent
bcf060fab6
commit
41b2945ced
4 changed files with 53 additions and 21 deletions
|
@ -73,6 +73,11 @@ creating the window. Note that this is more powerful than passing options
|
|||
through the feature string, as the renderer has more limited privileges in
|
||||
deciding security preferences than the main process.
|
||||
|
||||
In addition to passing in `action` and `overrideBrowserWindowOptions`,
|
||||
`outlivesOpener` can be passed like: `{ action: 'allow', outlivesOpener: true,
|
||||
overrideBrowserWindowOptions: { ... } }`. If set to `true`, the newly created
|
||||
window will not close when the opener window closes. The default value is `false`.
|
||||
|
||||
### Native `Window` example
|
||||
|
||||
```javascript
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue