electron/spec/fixtures/pages/world-safe-preload.js

9 lines
263 B
JavaScript

const { ipcRenderer, webFrame } = require('electron');
webFrame.executeJavaScript(`(() => {
return {};
})()`).then((obj) => {
// Considered safe if the object is constructed in this world
ipcRenderer.send('executejs-safe', obj.constructor === Object);
});