I'm trying to remove the Electron menubar from my window. I use this
myWindow.isMenuBarVisible(false);
But this doesn't work. Setting the 'AutoHideMenuBar' property works but that only hides the menu until the alt key is pressed.
What is the proper way to remove the Electron menubar?
I am using electron version 10. For me, I added parameter to hide menubar on BrowserWindow()
const mainWindow = new BrowserWindow({
width: 800,
height:600,
autoHideMenuBar: true //hide menu bar
})
You cannot alter visiblity of the menu with isMenuBarVisible(). It can only tell you if menu is visible or not.
isMenuBarVisible()Returns Boolean - Whether the menu bar is visible.
Try setMenu(null).
setMenu(menu)Sets themenuas the window's menu bar, setting it tonullwill remove the menu bar.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With