Skip to content

Instantly share code, notes, and snippets.

@FrankFang
Last active January 2, 2016 02:09
Show Gist options
  • Save FrankFang/8235045 to your computer and use it in GitHub Desktop.
Save FrankFang/8235045 to your computer and use it in GitHub Desktop.
hack location.origin
if (!window.location.origin) {
window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ':' + window.location.port: '');
}
// https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-Browser-Polyfills#other
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment