Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable the history swipe action in Google Chrome?

I am creating a browser-based desktop application with a text view. The text view may contain long horizontal lines. In Chrome, doing a left swipe on a track pad will sometimes activate the history.back action and sometimes activate the scroll left action. This is more than a little annoying for our users.

How do I disable the history swipe actions so that swiping will only scroll?

Note that I already supply a custom pushstate event handler. And also that moving forward/backward in history has appropriate meaning in the app, so I can't just disable history.

like image 703
Andrew Eisenberg Avatar asked Jan 21 '13 17:01

Andrew Eisenberg


1 Answers

From what I've seen, there is no officially-sanctioned way to fix this. Toggling swipe gestures is regulated at the system level, not at the browser, so the only way to disable them is to do so manually in the system preferences (turn off "swipe between pages" in System Preferences -> Trackpad -> More Gestures).

However, after searching for a little while, I stumbled upon a hack that uses JQuery's mousewheel.js to override the settings.

This plugin by Pablo Villalba of Teambox was the first implementation I found when searching for a plugin that implements such an override. Hope this helps.

like image 160
ruswick Avatar answered Sep 29 '22 21:09

ruswick