Enable 2-finger swipe back/forward gesture in Firefox in Ubuntu

This simple tutorial shows how to use 2-finger touchpad gesture to go back and forward in Firefox web browser in Ubuntu 22.04, Ubuntu 22.10, Fedora 36/37 with default Wayland session.

Mozilla Firefox web browser recently fixed the 2-finger touch-pad gestures for Linux user with Wayland session. For those who want to try out this feature, here’s the step by step guide show you how.

Firefox 2-finger swipe to navigate back / forward

Besides navigation, this tutorial will also enable 2-finger spread to enlarge web pages in Firefox.

Firefox 2 finger spread gesture to enlarge web page
NOTE: This tutorial ONLY works in Ubuntu with default Wayland session! And, Ubuntu 23.10 has the feature enabled out-of-the-box.

1. Enable Wayland support for Firefox

To enable the features, you just need to tell Firefox to run with Wayland enabled.

  1. For Ubuntu & Debian user, first open terminal either by pressing Ctrl+Alt+T on keyboard or searching from ‘Activities’ overview.
  2. When terminal opens, run command to edit the ‘.profile‘ file:
    gedit ~/.profile
  3. When file opens, add the new line into the end:
    export MOZ_ENABLE_WAYLAND=1

NOTE: for Ubuntu 22.10+, replace gedit with gnome-text-editor in the command.

  1. For Fedora, Rocky Linux user, open terminal and edit this file instead
    gedit .bash_profile
  2. And also add new export MOZ_ENABLE_WAYLAND=1 line to the end.

As well, if your system has switched to GNOME text editor, replace gedit in command with gnome-text-editor.

Step 2: Apply change

To apply the change, your have to just log out and login back. Then, launch Firefox and try out the gestures!

Hi, I'm Merilyn Ne, a computer geek working on Ubuntu Linux for many years and would like to write useful tips for beginners. Forgive me for language mistakes. I'm not a native speaker of English.