I've been scouring the interwebz and Atom-shell documentation trying to find out how to disable the back()
functionality of the backspace
key within a browser window.
I would prefer not to have to resort to a javascript onkeydown
listener (which works) and rather use something more native and at more of the application level instead of the browser window level.
The only way I have figured out to do this without the
onkeydown
listener is with a global-shortcut and the ipc events in the Electron api.First a disclaimer...
Disabling any key with a global shortcut really does disable it GLOBALLY on your computer! PLEASE BE CAREFUL WHEN USING GLOBAL SHORTCUTS! If you forget to unregister your shortcut, or do not handle it properly, you will find it difficult to fix your mistake without backspace!
That said this is what worked for me...
Alternatively you could add the shortcut inside an ipc "Toggle" event handler like this...