Skip to content

Instantly share code, notes, and snippets.

@nolvuscodes
Created February 3, 2023 01:55
Show Gist options
  • Save nolvuscodes/6a3a641078f4333dc93ecc409bf4bd94 to your computer and use it in GitHub Desktop.
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
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