1

I tried this but this gives me a new window with menu bar. I removed main window menu bar using win.setMenu(null) in main.js file. but I couldn't find a way to do it in new window ("add items window") please see the image below to see it clearly

onclick="window.open('addNew.html' ,'Add New Item', 'width=900 , height=400 , toolbar=no ,resizable=no')

window with menu bar

pushkin
  • 9,575
  • 15
  • 51
  • 95
akalanka
  • 37
  • 8
  • 1
    Does this answer your question? [Remove menubar from Electron app](https://stackoverflow.com/questions/39091964/remove-menubar-from-electron-app) – syarul Nov 09 '20 at 06:31
  • No, i removed main window menue bar using "win.setMenu(null)" in main.js file. but i couldn't find a way to do it in new window ("add items window") please find the attached image to see it clearly. thank you – akalanka Nov 09 '20 at 06:39

2 Answers2

5

You can intercept the new window creation and remove the menu the same way you remove it for your main window.

const { app } = require("electron");
app.on("browser-window-created", (e, win) => {
    win.removeMenu();
});
pushkin
  • 9,575
  • 15
  • 51
  • 95
0

I used 'Menu.setApplicationMenu(null)' insted of 'win.setMenu(null)'. this works for me. thank you.

akalanka
  • 37
  • 8