Created
November 30, 2023 12:43
-
-
Save t57ser/9ca91183cb53fd45eb6c73c42f92903e to your computer and use it in GitHub Desktop.
Can not reopen devtools with electron 28.0.0-beta.10
This file contains 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
let { app, BrowserWindow, ipcMain, session} = require("electron") | |
const electron = require("electron"); | |
function createWindow() { | |
let win = new BrowserWindow({ | |
}) | |
win.loadURL("https://www.example.com"); | |
win.webContents.on("context-menu", (e, props) => { | |
const menu = new electron.Menu(); | |
const item = new electron.MenuItem({ | |
label: "inspectElement", | |
click: () => { | |
win.webContents.openDevTools({mode: "detach"}); | |
}, | |
}); | |
menu.append(item); | |
menu.popup({ | |
window: win, | |
}); | |
}); | |
} | |
app.on("ready", createWindow) | |
app.on("window-all-closed", () => { | |
app.quit() | |
}) |
This file contains 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
{ | |
"main": "main.js", | |
"scripts": { | |
"start": "electron ." | |
}, | |
"devDependencies": { | |
"electron": "28.0.0-beta.10" | |
}, | |
"dependencies": { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment