Firefox is a wonderful web browser, and it can be easily installed on flatpak-based operating systems like elementaryOS through Flathub. However, the default settings in Firefox from Flathub yield a choppy scrolling experience.
Fortunately, there is a very easy fix that yields buttery smooth, high-precision scrolling. That fix is to enable xinput2 in Firefox, and can be done by entering the following command in the Terminal:
echo export MOZ_USE_XINPUT2=1 | sudo tee /etc/profile.d/use-xinput2.sh
Log out and then log back in, and Firefox scrolling should now be smooth and precise. For an even better fine-tuning, inside of Firefox go to Settings > Preferences and turn off the old “smooth scrolling” by unchecking the box for that setting.
For a deep dive into the various characteristics of scrolling, and what goes on under the hood to achieve it, see Pavel Fatin’s post Scrolling with pleasure.
Disable kinetic scrolling
By default, Firefox has a feature where it continues scrolling even after you stop moving your fingers across the trackpad. I find this really annoying. Kamil Paral has a very useful post that shows how to easily disable this new “feature.” Just open a new tab in Firefox and type
about:config to go to the advanced configuration options. Search for
apz.gtk.kinetic_scroll.enabled and set it to
false. And then enjoy browsing the web!