Last active
December 20, 2015 12:39
-
-
Save incompl/6132669 to your computer and use it in GitHub Desktop.
jQuery code to keep your site in webapp mode on iOS when clicking links. Bonus feature: links that have the `external` class will switch to Safari when clicked.
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 === true) { | |
$("body").on("click", "a", function(e) { | |
if (!$(this).is(".external")) { | |
e.preventDefault(); | |
window.location = this.getAttribute("href"); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment