DEV Community

Cover image for Disable two-finger swipe left/right page navigation gesture of Chromium-based browsers on macOS.
Victor Aremu
Victor Aremu

Posted on

3 1

Disable two-finger swipe left/right page navigation gesture of Chromium-based browsers on macOS.

Chromium-based browsers i.e (Chrome, Brave) by default are shipped with two-finger gestures used for navigating to next or previous page depending on the direction you swipe.
If for some reason you want to disable this feature, you can do this by setting AppleEnableSwipeNavigateWithScrolls to FALSE.

Open your Terminal app, copy the commands below, paste it in your terminal, hit the enter key to run it.

appName="TypeTheNameOfTheChromiumBaseBrowserInstalledOnYourMacHere"
bundleID=$(osascript -e 'id of app "'$appName'"')
defaults write $bundleID AppleEnableSwipeNavigateWithScrolls -bool FALSE
Enter fullscreen mode Exit fullscreen mode

Remember to set appName=”To The Name Of The Chronimum Based Browser Installed on your Mac”. For example, I have Brave Browser installed, mine goes like this appName=”Brave”

Close your Terminal app, then restart your browser, do the gesture, it’s gone right? 🍻🌚

Care to know what these commands do?

Below, I provide step by step explanation of each command.

# Set your app name - the Chromium Browser (i.e Chrome, Brave) in a variable.
appName="Brave"

# Get the bundle Id of the Chromium Browser, store it in a variable.
bundleID=$(osascript -e 'id of app "'$appName'"')

# Example: Get the bundle Id of Brave browser
# Returns:
# com.brave.Browser

# Now let's set a flag to disable the gesture navigation.
defaults write $bundleID AppleEnableSwipeNavigateWithScrolls -bool FALSE
Enter fullscreen mode Exit fullscreen mode

Bouns

Okay, I want the gesture back what do I do? Easy, just close your browser. Open your Terminal app, copy and paste the commands below, hit the enter key. Make sure your set the appName to the browser’s name.

appName="TypeTheNameOfTheChromiumBaseBrowserInstalledOnYourMacHere"
bundleID=$(osascript -e 'id of app "'$appName'"')
defaults write $bundleID AppleEnableSwipeNavigateWithScrolls -bool TRUE
Enter fullscreen mode Exit fullscreen mode

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Eliminate Context Switching and Maximize Productivity

Pieces.app

Pieces Copilot is your personalized workflow assistant, working alongside your favorite apps. Ask questions about entire repositories, generate contextualized code, save and reuse useful snippets, and streamline your development process.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay