2

There are other questions and answers about how to enable the key Backspace to go back to the previous page in Safari, but none of them work on my newly installed Mojave even though it used to work on High Sierra.

How can I enable this behaviour in Mojave?

  • This doesn't work? defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2BackspaceKeyNavigationEnabled -bool YES – Marc Wilson Oct 2 '18 at 16:03
  • @MarcWilson No, it doesn't. – marczellm Oct 3 '18 at 9:55
2

You can add a keyboard shortcut from the terminal, but this requires you to disable system integrity in macOS 10.14 Mojave and later.

defaults write com.apple.Safari NSUserKeyEquivalents -dict-add Back "\U232b"

Alternative, you can install a Safari Extension which injects a script that bring back the functionality:

https://github.com/yene/Safari-Backspace

For example:

document.addEventListener("DOMContentLoaded", function(event) {
    function handleBackspace(e) {
        if (e.keyCode === 8 && !e.ctrlKey && !e.shiftKey
            && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA'
            && e.target.contentEditable !== 'true' // TinyMCE
            ) {
            e.preventDefault();
            window.history.go(-1);
        }
    }
    window.addEventListener('keydown', handleBackspace, false);
});
| improve this answer | |
  • Anyone know why this requires SIP to be off? – Wowfunhappy Aug 12 at 23:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .