feat: add ContextBridgeMutability feature (#27348)

This commit is contained in:
Nikita Kot 2021-03-22 18:16:35 +01:00 committed by GitHub
parent fa320eeb90
commit e99893df22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 88 additions and 0 deletions

View file

@ -0,0 +1,20 @@
const { app, BrowserWindow } = require('electron');
const path = require('path');
let win;
app.whenReady().then(function () {
win = new BrowserWindow({
webPreferences: {
contextIsolation: true,
preload: path.join(__dirname, 'preload.js')
}
});
win.loadFile('index.html');
win.webContents.on('console-message', (event, level, message) => {
console.log(message);
});
win.webContents.on('did-finish-load', () => app.quit());
});