Whenever I accidentally scroll too far left or right in Firefox, it goes back or forth in my history, which is very annoying. How could I disable this?

EDIT: Fixed it by disabling the gestures. Thanks @sudotstar@kbin.social!