Skip to content

Instantly share code, notes, and snippets.

@Kilian
Created March 16, 2021 15:57
Show Gist options
  • Save Kilian/b9c5a45bf59f6ba748041d000414e571 to your computer and use it in GitHub Desktop.
Save Kilian/b9c5a45bf59f6ba748041d000414e571 to your computer and use it in GitHub Desktop.
contex menu in browserView containing devtools broke between v12.0.0-beta.31 and v12.0.0
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
const {app, BrowserWindow, BrowserView} = require('electron')
function createWindow () {
const mainWindow = new BrowserWindow({
width: 1000,
height: 1000,
})
// and load the index.html of the app.
mainWindow.loadFile('index.html')
devToolsView = new BrowserView();
mainWindow.setBrowserView(devToolsView);
mainWindow.webContents.setDevToolsWebContents(devToolsView.webContents);
mainWindow.openDevTools();
devToolsView.setBounds({
x:500,
y:0,
width: 500,
height: 1000,
});
devToolsView.webContents.focus();
}
app.whenReady().then(createWindow)
app.on('window-all-closed', function () {
app.quit()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment