feat: add webContents.setWindowOpenHandler API (#24517)
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
This commit is contained in:
parent
6b222a2d8a
commit
0b85fdf26c
56 changed files with 2087 additions and 885 deletions
10
spec/fixtures/api/window-open-preload.js
vendored
10
spec/fixtures/api/window-open-preload.js
vendored
|
@ -1,9 +1,15 @@
|
|||
const { ipcRenderer } = require('electron');
|
||||
const { ipcRenderer, webFrame } = require('electron');
|
||||
|
||||
setImmediate(function () {
|
||||
if (window.location.toString() === 'bar://page/') {
|
||||
const windowOpenerIsNull = window.opener == null;
|
||||
ipcRenderer.send('answer', process.argv, typeof global.process, windowOpenerIsNull);
|
||||
ipcRenderer.send('answer', {
|
||||
nativeWindowOpen: webFrame.getWebPreference('nativeWindowOpen'),
|
||||
nodeIntegration: webFrame.getWebPreference('nodeIntegration'),
|
||||
sandbox: webFrame.getWebPreference('sandbox'),
|
||||
typeofProcess: typeof global.process,
|
||||
windowOpenerIsNull
|
||||
});
|
||||
window.close();
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue