Goal
I'm trying to remove the Help
menu from Electron app's menu.
I don't want to setApplicationMenu
of my own because it's fine to use the default menu except for the help, which points to Electron's own help pages.
Attempts
I've tried the following ways and failed in each case:
Remove the tail item, i.e., the Help
var menu = Menu.getApplicationMenu();
menu.items.pop();
Make it invisible
var menu = Menu.getApplicationMenu();
for(var i=0; i<menu.items.length; i++) {
if (menu.items[i].role == 'help') {
menu.items[i].visible = false;
break;
}
}
Remove the menu
mainWindow.removeMenu();
This just doesn't work on macOS with my electron version: 10.1.0.
Question
What's wrong? Should I create a template instead?