-
-
Save bright-spark/41330c65a4bec51ec62b to your computer and use it in GitHub Desktop.
Prevent internal links in iOS standalone web apps from opening in Mobile Safari
This file contains hidden or 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
| if (window.navigator.standalone) { | |
| var local = document.domain; | |
| $('a').click(function() { | |
| var a = $(this).attr('href'); | |
| if ( a.match('http://' + local) || a.match('http://www.' + local) ){ | |
| event.preventDefault(); | |
| document.location.href = a; | |
| } | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment