Disable web page navigation on swipe(back and forward)

You Should Try this solution in two way :

1) CSS only fix for Chrome/Firefox

 html, body {
    overscroll-behavior-x: none;
}

2) JavaScript fix for Safari

if (window.safari) {
  history.pushState(null, null, location.href);
  window.onpopstate = function(event) {
      history.go(1);
  };
}

Over time, Safari will implement overscroll-behavior-x and we’ll be able to remove the JS hack

Possible duplicate of iOS 7 – is there a way to disable the swipe back and forward functionality in Safari?

Leave a Comment