Ark
const {app, Menu} = require('electron')
let Platform = require('./platform')
module.exports = {
MainMenu: function() {
const isMac = process.platform === 'darwin'
const template = [
...(isMac ? [{
label: app.name,
submenu: [
{ role: 'about' },
{ type: 'separator' },
{ role: 'hide' },
{ role: 'hideOthers' },
{ role: 'unhide' },
{ role: 'quit' }
]
}] : []),
{
label: 'File',
isMac ? { role: 'close' } : { role: 'quit' }
},
label: 'Edit',
{ role: 'undo' },
{ role: 'redo' },
{ role: 'cut' },
{ role: 'copy' },
{ role: 'paste' },
...(isMac ? [
{ role: 'pasteAndMatchStyle' },
{ role: 'delete' },
{ role: 'selectAll' },
label: 'Speech',
{ role: 'startSpeaking' },
{ role: 'stopSpeaking' }
}
] : [
{ role: 'selectAll' }
])
label: 'View',
label: 'Reload',
accelerator: 'CmdOrCtrl+R',
click: async () => {
mainWindow.reload()
setTimeout(() => {Platform.Class()}, 1000)
{ role: 'toggleDevTools' },
label: 'Open WebView Developer Tools',
accelerator: 'CmdOrCtrl+Shift+W',
click: async () => {if (isDev) {mainWindow.webContents.executeJavaScript(`document.querySelector('.active webview').openDevTools()`)}else {console.log('Not available in production mode.')}}
{ role: 'resetZoom' },
{ role: 'zoomIn' },
{ role: 'zoomOut' },
{ role: 'togglefullscreen' }
label: 'Window',
{ role: 'minimize' },
{ role: 'zoom' },
{ role: 'front' },
{ role: 'window' }
{ role: 'close' }
role: 'help',
label: 'Website',
const { shell } = require('electron')
await shell.openExternal(process.env.Website)
label: 'Support',
await shell.openExternal(process.env.Support)
label: 'Source Code',
await shell.openExternal(process.env.SourceCode)
const menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu)