I'm clearly not the only person frustrated by Firefox moving back/forward in history when using the touchpad to scroll. One problem is that a slightly off-vertical scroll could be interpreted as a sideways gesture. See:
https://superuser.com/questions/1427043/how-do-i-stop-firefox-from-going-to-a-previous-page-when-i-swipe-my-trackpad-rig
In Firefox's about:config
I deleted the values for browser.gesture.swipe.left
and browser.gesture.swipe.right
and set widget.disable-swipe-tracker
to true
. But this still did not resolve my issue - even scrolling very vertically seemed to send me back/forward occasionally, and some people reported this happened using mouse scroll wheels not just touchpads.
In fact the issue was that I was running GhostBSD as a guest in VirtualBox. See
https://forums.freebsd.org/threads/nomadbsd-and-ghostbsd-which-one-is-better.95475/
https://forums.freebsd.org/threads/mouse-wheel-strange-behavior-with-firefox.57494/
I did have the pointing device in VirtualBox set as PS/2 mouse, which is good. But inside the GhostBSD guest, this was interpreted as having 12 mouse buttons!!
https://unix.stackexchange.com/questions/20550/how-to-disable-the-forward-back-buttons-on-my-mouse
bigsneaky@bigsneaky-ghostbsd ~> xmodmap -pp
There are 12 pointer buttons defined.
Physical Button
Button Code
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
10 10
11 11
12 12
So I disabled mouse buttons 8 upwards:
bigsneaky@bigsneaky-ghostbsd ~> echo "pointer = 1 2 3 4 5 6 7 0 0 0 0 0" > ~/.Xmodmap
I then restarted the virtual machine, and xmodmap -pp
showed this change had taken effect.
Now in Firefox, I'm able to scroll up and down without accidentally going back and forth in my browser history!!