-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Electron 7.1.2 - Can't remove the main BrowserWindow menu #21268
Comments
It works as expected in 6.1.5 |
I have tried with the latest beta, and still doesn't work. I think I will try with 6.1.5. |
Okay, I will edit the main post, but this is what I found so far: Any ideas? |
Okay. I managed to solve it, but I am not sure if this is how is supposed to work in 7.x.x, 8.x.x and 9.x.x. Instead of using win.setMenuBarVisibility(true), I used autoHideMenuBar: true, in the window properties, like this: |
Setting |
Duplicate of #21088 |
Preflight Checklist
Issue Details
Expected Behavior
The menu that appears below the app title (the one with File, Edit, View...) must dissappear.
Actual Behavior
Nothing. It does nothing. The menu is still there. as if nothing happened.
To reproduce
This is basically the code I am testing:
const { app, BrowserWindow } = require('electron');
function createWindow() {
let win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true,
}
})
win.setMenuBarVisibility(false);
win.loadFile('./public/index.html')
}
app.on('ready', createWindow)
Everything works as expected, except the menu, which it still shows.
Screenshots
https://i.imgur.com/kJJf0JE.png
The text was updated successfully, but these errors were encountered: