I want to disable the two finger swipe that causes Chrome going back or forward. I have a website where the user might lose progress on his work if he doesn't specifically saves.
I have tried using window.onbeforeunload
but that doesn't seem to work if I have hashes in the url (back forward would change between www.example.com/work/#step1#unsaved www.example.com/work/#step0) and the event doesn't seem to trigger.
I was about to switch to another solution but today I noticed that in Google Docs it's completely disabled. How did they achieve that?
You can't turn off the gesture navigation for the right side in spite you can use try changing the sensitivity of the right/left side or try 3 button navigation. To change sensitivity Go to settings>system>gesture>system navigation settings and try changing the sensitivity for the right side.
Open up Chrome for Android and type “chrome://flags” in the address bar at the top. Once in the flags area, type “history nav” in the search bar. When you see the “History navigation with gesture” option, tap the box where it says “Default.” Tap on the “Enable” option.
Disable Chrome two fingers back/forward swipe
This worked for me:
body { overscroll-behavior-x: none; }
Make the specific page open in a new tab/window by default (by putting target="_blank"> in hyperlink). That way there'll be no previous page to go back to.
Or prevent Horizontal Scrolling by default. To do that, you can use jquery.mousewheel to do:
$(document).on("mousewheel",function(event,delta){ // prevent horizontal scrolling if (event.originalEvent.wheelDeltaX !== 0) { event.preventDefault(); } });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With