Search code examples
javascriptweb-applicationsios7mobile-safariswipe-gesture

Mobile safari clear tab or detect history


I'm trying to solve this problem:

iOS 7 - is there a way to disable the swipe back and forward functionality in Safari?

I have custom navigation on swipe and if there is history in the tab mobile safari automatically goes back in history. Is there any way to clear the tab history or detect that tab history exists so that it can open the site in a new tab?


Solution

  • I don't believe you can clear the tab history, but you could check the history length with window.history.length and open a new tab.