Created
July 28, 2014 14:41
-
-
Save georgismitev/bb5cdb8d2d94d132f7b1 to your computer and use it in GitHub Desktop.
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
| // Url.js from https://github.com/Mikhus/jsurl | |
| function isiOS() { | |
| return navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false; | |
| } | |
| function isSafari() { | |
| var ua = navigator.userAgent.toLowerCase(); | |
| return (ua.indexOf('safari') !== -1) && ua.indexOf('chrome') === -1; | |
| } | |
| function html5Capable() { | |
| return isiOS() || isSafari(); | |
| } | |
| function isHtml5PlayLink() { | |
| return /\/play_html5$/.test(window.location.href); | |
| } | |
| if (html5Capable() && !isHtml5PlayLink()) { | |
| var url = new Url(window.location.href); | |
| url.path = url.path.concat("/play_html5") | |
| alert(url.path); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment