Skip to content

Instantly share code, notes, and snippets.

Created March 18, 2014 13:47
Show Gist options
  • Save anonymous/9620376 to your computer and use it in GitHub Desktop.
Save anonymous/9620376 to your computer and use it in GitHub Desktop.
widh height redirection
(function () {
try {
var orcWidth = parseInt(window.location.search.match(/width=(\d+)/)[1], 10);
var orcHeight = parseInt(window.location.search.match(/height=(\d+)/)[1], 10);
if (orcWidth !== window.innerWidth || orcHeight !== window.innerHeight) {
// If browse and Orc dimension do not match up, reload but without the
// width, height and size querystring
var newUrl = window.location.href.replace(/width=\d+&?/, '').replace(/height=\d+&?/, '').replace(/size=\w+&?/, '');
window.location.herf = newUrl;
}
} catch (e) {
console.err('Failed to verify dimension from Orc', e);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment