Created
March 18, 2014 13:47
-
-
Save anonymous/9620376 to your computer and use it in GitHub Desktop.
widh height redirection
This file contains 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
(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