summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--main.js17
1 files changed, 15 insertions, 2 deletions
diff --git a/main.js b/main.js
index 566a954..b528725 100644
--- a/main.js
+++ b/main.js
@@ -3,6 +3,9 @@ const path = require('path');
const config = require(path.join(__dirname, 'config.json'));
+if (config.name)
+ app.setName(config.name);
+
// Load flash
let flash;
if (process.arch !== 'x64')
@@ -26,6 +29,16 @@ app.commandLine.appendSwitch('ppapi-flash-version', '32.0.0.371');
// Menu
// https://www.electronjs.org/docs/latest/api/menu
const menuTemplate = [
+ // macOS first menu is always the "app name" one.
+ ...(process.platform === 'darwin' ? [{
+ label: app.name,
+ submenu: [
+ { role: 'about' },
+ { type: 'separator' },
+ { role: 'quit' }
+ ]
+ }] : []),
+
{
label: 'File',
submenu: Object.keys(config.urls).map(urlName => ({
@@ -33,7 +46,7 @@ const menuTemplate = [
click: function(menuItem, browserWindow, event) {
browserWindow.loadURL(config.urls[urlName]);
}
- })).concat([
+ })).concat(process.platform === 'darwin' ? [] : [
{ type: 'separator' },
{ role: 'quit' }
])
@@ -83,4 +96,4 @@ app.whenReady().then(() => {
app.on('window-all-closed', () => {
// Quit when all windows closed - even on macOS.
app.quit()
-}); \ No newline at end of file
+});