From 8159717e477a437342369ae38a767a5dca31864b Mon Sep 17 00:00:00 2001 From: David Sulpy Date: Sun, 8 Sep 2019 16:53:08 -0700 Subject: [PATCH] added options to set the menubar of the prefs browserwindow or remove it entirely to avoid a default menu bar with electron framework 5+ --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index adddc16..1307849 100644 --- a/index.js +++ b/index.js @@ -178,6 +178,12 @@ class ElectronPreferences extends EventEmitter2 { this.prefsWindow = new BrowserWindow(browserWindowOpts); + if (this.options.menuBar) { + this.prefsWindow.setMenu(this.options.menuBar); + } else { + this.prefsWindow.removeMenu(); + } + this.prefsWindow.loadURL(url.format({ 'pathname': path.join(__dirname, 'build/index.html'), 'protocol': 'file:',