Skip to content

Instantly share code, notes, and snippets.

@georgismitev
Created July 28, 2014 14:41
Show Gist options
  • Select an option

  • Save georgismitev/bb5cdb8d2d94d132f7b1 to your computer and use it in GitHub Desktop.

Select an option

Save georgismitev/bb5cdb8d2d94d132f7b1 to your computer and use it in GitHub Desktop.
// 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