electron/spec-main/fixtures/api/test-menu-visibility/main.js

17 lines
345 B
JavaScript
Raw Normal View History

2020-03-20 20:28:31 +00:00
const { app, BrowserWindow } = require('electron');
2020-03-20 20:28:31 +00:00
let win;
app.whenReady().then(function () {
2020-03-20 20:28:31 +00:00
win = new BrowserWindow({});
win.setMenuBarVisibility(false);
setTimeout(() => {
if (win.isMenuBarVisible()) {
2020-03-20 20:28:31 +00:00
console.log('Window has a menu');
} else {
2020-03-20 20:28:31 +00:00
console.log('Window has no menu');
}
2020-03-20 20:28:31 +00:00
app.quit();
});
});