docs: document outlivesOpener option in window open handler (#36486)
This commit is contained in:
parent
665cf03f74
commit
835e248dff
1 changed files with 5 additions and 2 deletions
|
@ -1155,7 +1155,7 @@ Ignore application menu shortcuts while this web contents is focused.
|
||||||
|
|
||||||
#### `contents.setWindowOpenHandler(handler)`
|
#### `contents.setWindowOpenHandler(handler)`
|
||||||
|
|
||||||
* `handler` Function<{action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}>
|
* `handler` Function<{action: 'deny'} | {action: 'allow', outlivesOpener?: boolean, overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}>
|
||||||
* `details` Object
|
* `details` Object
|
||||||
* `url` string - The _resolved_ version of the URL passed to `window.open()`. e.g. opening a window with `window.open('foo')` will yield something like `https://the-origin/the/current/path/foo`.
|
* `url` string - The _resolved_ version of the URL passed to `window.open()`. e.g. opening a window with `window.open('foo')` will yield something like `https://the-origin/the/current/path/foo`.
|
||||||
* `frameName` string - Name of the window provided in `window.open()`
|
* `frameName` string - Name of the window provided in `window.open()`
|
||||||
|
@ -1170,8 +1170,11 @@ Ignore application menu shortcuts while this web contents is focused.
|
||||||
be set. If no post data is to be sent, the value will be `null`. Only defined
|
be set. If no post data is to be sent, the value will be `null`. Only defined
|
||||||
when the window is being created by a form that set `target=_blank`.
|
when the window is being created by a form that set `target=_blank`.
|
||||||
|
|
||||||
Returns `{action: 'deny'} | {action: 'allow', overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` cancels the creation of the new
|
Returns `{action: 'deny'} | {action: 'allow', outlivesOpener?: boolean, overrideBrowserWindowOptions?: BrowserWindowConstructorOptions}` - `deny` cancels the creation of the new
|
||||||
window. `allow` will allow the new window to be created. Specifying `overrideBrowserWindowOptions` allows customization of the created window.
|
window. `allow` will allow the new window to be created. Specifying `overrideBrowserWindowOptions` allows customization of the created window.
|
||||||
|
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.
|
||||||
Returning an unrecognized value such as a null, undefined, or an object
|
Returning an unrecognized value such as a null, undefined, or an object
|
||||||
without a recognized 'action' value will result in a console error and have
|
without a recognized 'action' value will result in a console error and have
|
||||||
the same effect as returning `{action: 'deny'}`.
|
the same effect as returning `{action: 'deny'}`.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue