electron/spec-main/fixtures/api/window-open-preload.js
Jeremy Rose d44a187d0b
feat: remove nativeWindowOpen option (#29405)
Co-authored-by: Cheng Zhao <zcbenz@gmail.com>
Co-authored-by: Milan Burda <milan.burda@gmail.com>
2022-01-06 09:28:03 -08:00

13 lines
398 B
JavaScript

const { ipcRenderer, webFrame } = require('electron');
setImmediate(function () {
if (window.location.toString() === 'bar://page/') {
const windowOpenerIsNull = window.opener == null;
ipcRenderer.send('answer', {
nodeIntegration: webFrame.getWebPreference('nodeIntegration'),
typeofProcess: typeof global.process,
windowOpenerIsNull
});
window.close();
}
});