Skip to content

Instantly share code, notes, and snippets.

@rsteckler
Created December 12, 2018 01:25
Show Gist options
  • Save rsteckler/5220689d645ba8a27e97a3a196f500a8 to your computer and use it in GitHub Desktop.
Save rsteckler/5220689d645ba8a27e97a3a196f500a8 to your computer and use it in GitHub Desktop.
javascript:(function(){
var key = document.cookie.match('(^|;)\\s*ADRUM\\s*=\\s*([^;]+)');
if (!key) {
alert('Unable to find redirect cookie');
return;
}
var value=key.pop();
var rIndex=value.indexOf('r=');
var loc=decodeURIComponent(value.substr(rIndex+2));
var d=document.createElement('div');
d.appendChild(document.createTextNode('Redirecting to ' + loc));
d.style.position="fixed";
d.style.left='50%';
d.style.top='50%';
d.style.width='auto';
d.style.height='auto';
d.style.transform='translate(-50%,-50%)';
d.style.border='solid 2px red';
document.body.appendChild(d);
setTimeout(function(){
window.location.href=loc;
}, 1000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment