Created
August 12, 2013 20:16
-
-
Save chriscooning/6214717 to your computer and use it in GitHub Desktop.
fixes links within webpage "app" in iOS5 - forces links to stay in native view rather than opening in safari
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script>(function(a,b,c){if(c in b&&b[c]){var d,e=a.location,f=/^(a|html)$/i;a.addEventListener("click",function(a){d=a.target;while(!f.test(d.nodeName))d=d.parentNode;"href"in d&&(d.href.indexOf("http")||~d.href.indexOf(e.host))&&(a.preventDefault(),e.href=d.href)},!1)}})(document,window.navigator,"standalone")</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment