fix: window.open not overriding parent's webPreferences (#32325)

Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
This commit is contained in:
trop[bot]
2022-01-06 09:18:48 +09:00
committed by GitHub
parent 52c878b6bc
commit 9af52185e1
11 changed files with 97 additions and 31 deletions

View File

@@ -65,6 +65,9 @@ window.open('https://github.com', '_blank', 'top=500,left=200,frame=false,nodeIn
`features` will be passed to any registered `webContents`'s
`did-create-window` event handler in the `options` argument.
* `frameName` follows the specification of `windowName` located in the [native documentation](https://developer.mozilla.org/en-US/docs/Web/API/Window/open#parameters).
* When opening `about:blank`, the child window's `WebPreferences` will be copied
from the parent window, and there is no way to override it because Chromium
skips browser side navigation in this case.
To customize or cancel the creation of the window, you can optionally set an
override handler with `webContents.setWindowOpenHandler()` from the main