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

11 lines
318 B
JavaScript

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