feat: Allow creation of new window to be customizable. (#41432)

This commit is contained in:
Krzysztof Halwa 2024-02-29 16:15:01 +01:00 committed by GitHub
parent 04df5ce492
commit a0dad83ded
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 441 additions and 220 deletions

View file

@ -0,0 +1,7 @@
# WindowOpenHandlerResponse Object
* `action` string - Can be `allow` or `deny`. Controls whether new window should be created.
* `overrideBrowserWindowOptions` BrowserWindowConstructorOptions (optional) - Allows customization of the created window.
* `outlivesOpener` boolean (optional) - By default, child windows are closed when their opener is closed. This can be
changed by specifying `outlivesOpener: true`, in which case the opened window will not be closed when its opener is closed.
* `createWindow` (options: BrowserWindowConstructorOptions) => WebContents (optional) - If specified, will be called instead of `new BrowserWindow` to create the new child window and event [`did-create-window`](../web-contents.md#event-did-create-window) will not be emitted. Constructed child window should use passed `options` object. This can be used for example to have the new window open as a BrowserView instead of in a separate window.