Prevent BrowserWindow from reloading?


When I press CTRL + R in my app, my main BrowserWindow reloads! How can I prevent this? I’m aware of onbeforeunload, but this’ll prevent the user from closing it as well.

Thanks for the help!


Bumping and making this post a little longer than usual because I assume Discourse will yell at me for making this too short…


Does that happen after you package your application or just while running using something like electron-prebuilt or similar?

On OS X I only get a quit menu item when running a packaged application but get reload and toggle developer tools and a bunch of other menu stuff when running with electron-prebuilt or dragging an app folder onto

If none of that helps you can always use the menu module to completely customize the menus.


The menu bar isn’t the problem, I actually just got rid of it. It’s reloading the page via CTRL/CMD + R.

EDIT: Wait. I’m dumb. It’s just hidden, it doesn’t get rid of the accelerator shortcuts. Bah. Thanks @john for reminding me about that.