How to get Mouse buttons 4 / 5 (Browser back / Browser forward) working in Firefox?

13,637

Solution 1

GOOD NEWS: Bug Fixed in FF 92

The bug is fixed and the fix will be included in Firefox version 92 which will be released in early September 2021.

In the current Nightly Build (version 92) it is already working and you can use the Mouse Buttons 4 and 5 as expected for browser navigation back and forward.
I tested it with MacOS and an ordinary Dell mouse.


UPDATE (September 7, 2021)

Firefox 92 was released today as described earlier and the mouse buttons 4 and 5 work like a charm 🥳
Case closed.

Solution 2

I can recommend the SensibleSideButtons project. It’s easy to install, and it will fix those mouse buttons in many other programs, too.

Solution 3

I had the same issue.

System Information

  • macOS 10.15.5
  • Firefox 83.0
  • Logitech MX Master 2S Wireless Mouse

Steps to Reproduce

  • Open Firefox.
  • Navigate to page.
  • Click back, click forward.

Resolution

  • Install Logitech Options for macOS.
  • Open application.
  • Allow application to control your computer: System Preferences > Security & Privacy > Accessibility > Check Logi Options and Logi Options Daemon

Solution 4

Had the same issue with a Logitech MX Master 3 / MacOS 10.15.7 / Firefox 81.0.2 (back/fwd buttons suddenly stopped working for no discernable reason). A NVRAM / PRAM reset fixed it for me!

Share:
13,637
TrinitronX
Author by

TrinitronX

If you appreciate my questions/answers on SO and can afford to, please support me on GitHub Sponsors or LiberaPay. In my day job, I'm an SRE / DevOps Engineer. I currently work on supporting infrastructure for Education Technologies. In the past, I have supported the backend for applications that help the global mailbox provider network to prevent SPAM and collect data to assist in SPAM & Email Fraud prevention. I automate virtual machine provisioning & software configuration with DevOps, CI/CD, Monitoring and Clustering technologies such as Chef, Ansible, Docker, Jenkins, GoCD, Kubernetes, Graphite, Grafana, Kafka, ElasticSearch etc... For fun, I'm into Electronic Music Production, DJing, and Hardware & Circuit hacking.

Updated on June 13, 2022

Comments

  • TrinitronX
    TrinitronX almost 2 years

    First, I need to say that I'm aware there is some confusion as to what button numbering scheme convention is used for these "Browser back" and "Browser forward" mouse buttons depending on whether you use numbering starting from zero 0 or one 1. Since this question is about Firefox, I'll go by Mozilla's numbering scheme here.

    I've been struggling with an issue seen only in Firefox where Mouse buttons 4 (back) and 5 (forward) appear to Firefox as if they were a button 2 click (Middle button click) event. Pressing either button 4 or 5 results in the circular "autoscrolling" icon with Up and Down arrows appearing:

    Firefox autoscroll icon

    I've done some debugging using this Mouse Event Test Page. Results are different between Chrome and Firefox. It appears that the "which" JS event attribute numbers these as 4 and 5, while the button attribute numbers them as 3 and 4. Regardless, Google Chrome interprets them as "Browser back" and "Browser Forward" buttons correctly, while Firefox does not.

    • Chrome:

      • Mouse Button "4" (back)

        mousedown   which=4 button=3 buttons=8
        mouseup     which=4 button=3 buttons=0
        
      • Mouse Button "5" (forward)

        mousedown   which=5 button=4 buttons=16
        mouseup     which=5 button=4 buttons=0
        
      • Mouse Button "2" (middle click)

        mousedown   which=2 button=1 buttons=4
        mouseup     which=2 button=1 buttons=0
        
    • Firefox:

      • Mouse Button "4" (back)

        mousedown   which=2 button=1 buttons=8
        mouseup     which=2 button=1 buttons=0
        
      • Mouse Button "5" (forward)

        mousedown   which=2 button=1 buttons=16
        mouseup     which=2 button=1 buttons=0
        
      • Mouse Button "2" (middle click)

        mousedown   which=2 button=1 buttons=4
        mouseup     which=2 button=1 buttons=0
        

    As the page says, not all browsers work correctly. It also states:

    However, in some browsers, the defaults cannot be disabled, so various strange side effects may occur.

    In Firefox, I notice clicking with all three of these buttons launches a new tab with javascript:void(null). This is the same as the link's URL attribute (href="javascript:void(null)"), as we can see from that page's source code. So this behavior is consistent with a Middle Button Click event, which usually will launch a new tab with that URL.

    Is it possible to get these buttons for "Browser Back" and "Browser Forward" working properly in Firefox?

  • Fabian Schmick
    Fabian Schmick over 3 years
    Unfortunately this didn't work for me, have the same issue (but only in firefox)
  • TrinitronX
    TrinitronX over 3 years
    It turns out this was it! However, there are apparently now some extra steps. I had to add Logi Options Daemon to Accessibility, Input monitoring, and Screen Recording. Some of these were missing both Logi items to check, so I added them manually by clicking the + icon and navigating to: /Library/Application Support/Logitech/Logitech Options/Logi Options Daemon, and /Applications/Logi Options
  • TrinitronX
    TrinitronX over 3 years
    One other important note after experimenting a bit: The back / forward and mouse wheel buttons stopped working again after I tried to remove and re-add the Logi Options Daemon to each of these settings for testing purposes. The only thing that fixed it was a complete uninstall, reboot, re-install, reboot, and finally go into each of those System Preferences > Security & Privacy sections to uncheck & re-check each Logi* item again! When prompted to restart each program, do it! Somehow these settings were stuck in an non-operational state until that final step!
  • Jupeter
    Jupeter over 3 years
    This do the trick! Work not only with Logitech mouse.
  • simou
    simou about 3 years
    SensibleSideButtons interferes however with applications like VSCode.
  • Fabian Schmick
    Fabian Schmick about 3 years
    Didn't try it in VSCode. But I'm working with Jetbrains PHPStorm and can say there are no such issues. But good to know there are troubles in VSCode. Maybe you can have a look at the github issues of this project.
  • AlexD
    AlexD about 3 years
    Unfortunately, this solution won't work for wired mice as "Logitech Options" is expecting a USB dongle... and I have a M500s (M-U0007).... :-(
  • TrinitronX
    TrinitronX almost 3 years
    Great news! Can't wait to finally squash this bug!
  • Jayden Lawson
    Jayden Lawson almost 3 years
    Tried the Nightly and can confirm it is fixed
  • TrinitronX
    TrinitronX over 2 years
    Firefox 92 released in Ubuntu 20.04 LTS repos as of 2021-09-09 !! I can confirm that this bug is fixed in Linux and MacOS with Logitech MX Master 2S and MX Master 3 mouses!
  • Sri Harsha Chilakapati
    Sri Harsha Chilakapati over 2 years
    Confirmed in Release version of Firefox 92.0.1