electron/spec-main/fixtures/api/test-menu-visibility/main.js
Cheng Zhao 3cb0ed306b fix: hiding window menu should work on startup (#21436)
* fix: menu visibility should not be overwritten on startup

* fix: removing menu for window without global menubar

* test: setMenu tests are not for mac
2019-12-09 11:17:36 -08:00

17 lines
360 B
JavaScript

const { app, BrowserWindow } = require('electron')
let win
app.on('ready', function () {
win = new BrowserWindow({})
win.loadURL('about:blank')
win.setMenuBarVisibility(false)
setTimeout(() => {
if (win.isMenuBarVisible()) {
console.log('Window has a menu')
} else {
console.log('Window has no menu')
}
app.quit()
})
})