There should be a main.js and possibly a call to includes file such as menu.js that contain the menu structure for Electron. Will look something like this:
In main.js you may see something like (which is including this file):
let myModule = require("./menu.js");
Just comment it out.
Alternatively look for something similar to (in a file named something like menu.js):
const { app, Menu } = require('electron')
const isMac = process.platform === 'darwin'
const template = [
// { role: 'appMenu' }
...(isMac ? [{
label: app.name,
submenu: [
{ role: 'about' },
{ type: 'separator' },
{ role: 'services' },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideothers' },
{ role: 'unhide' },
{ type: 'separator' },
{ role: 'quit' }
]
}] : []),
// { role: 'fileMenu' }
{
label: 'File',
submenu: [
isMac ? { role: 'close' } : { role: 'quit' }
]
},
// { role: 'editMenu' }
{
label: 'Edit',
submenu: [
{ role: 'undo' },
{ role: 'redo' },
{ type: 'separator' },
{ role: 'cut' },
{ role: 'copy' },
{ role: 'paste' },
...(isMac ? [
{ role: 'pasteAndMatchStyle' },
{ role: 'delete' },
{ role: 'selectAll' },
{ type: 'separator' },
{
label: 'Speech',
submenu: [
{ role: 'startspeaking' },
{ role: 'stopspeaking' }
]
}
] : [
{ role: 'delete' },
{ type: 'separator' },
{ role: 'selectAll' }
])
]
},
// { role: 'viewMenu' }
{
label: 'View',
submenu: [
{ role: 'reload' },
{ role: 'forcereload' },
{ type: 'separator' },
{ role: 'toggledevtools' },
{ type: 'separator' },
{ role: 'togglefullscreen' }
]
},
// { role: 'help' }
{
role: 'help',
submenu: [
{
label: 'Help',
click: async () => {
const { shell } = require('electron')
await shell.openExternal('https://github.com/blahblah')
}
}
]
}
]
const menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu)
And remove it.
In general renderer.js is where you keep your alternative functions, or you could specify any file, or a selection of files. Then you have package.json with dependencies etc.
Hope that helps!