Created
January 29, 2019 21:20
-
-
Save brpaz/2f16a803ba0c407829c1d70ede6f3d1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In the main process. | |
const { BrowserView, BrowserWindow } = require('electron') | |
let win = new BrowserWindow({ width: 800, height: 600 }) | |
win.on('closed', () => { | |
win = null | |
}) | |
let view = new BrowserView({ | |
webPreferences: { | |
nodeIntegration: false | |
} | |
}) | |
win.setBrowserView(view) | |
view.setBounds({ x: 0, y: 0, width: 300, height: 300 }) | |
view.webContents.loadURL('https://electronjs.org') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment