electron/spec/fixtures/api/window-open-preload.js

16 lines
522 B
JavaScript
Raw Normal View History

const { ipcRenderer, webFrame } = require('electron');
setImmediate(function () {
if (window.location.toString() === 'bar://page/') {
2020-03-20 20:28:31 +00:00
const windowOpenerIsNull = window.opener == null;
ipcRenderer.send('answer', {
nativeWindowOpen: webFrame.getWebPreference('nativeWindowOpen'),
nodeIntegration: webFrame.getWebPreference('nodeIntegration'),
sandbox: webFrame.getWebPreference('sandbox'),
typeofProcess: typeof global.process,
windowOpenerIsNull
});
2020-03-20 20:28:31 +00:00
window.close();
}
2020-03-20 20:28:31 +00:00
});