Created
February 3, 2023 01:55
-
-
Save nolvuscodes/6a3a641078f4333dc93ecc409bf4bd94 to your computer and use it in GitHub Desktop.
Read all comments below. This is the cleaner version for your Node.js App
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
const { app, BrowserWindow } = require("electron"); | |
app.on("ready", () => { | |
let mainWindow = new BrowserWindow({ | |
width: 800, | |
height: 600, | |
webPreferences: { | |
nodeIntegration: true | |
} | |
}); | |
mainWindow.loadFile("index.html"); | |
// Hide the developer tools. | |
mainWindow.webContents.closeDevTools(); | |
// Set the menu to null to hide the default menu. | |
mainWindow.setMenu(null); | |
}); | |
app.on("window-all-closed", () => { | |
app.quit(); | |
}); | |
app.on("browser-window-created", (event, win) => { | |
// Hide the menu on all windows including popups. | |
win.setMenu(null); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment