-
-
Save phatduckk/51f05ef9e065a121e4c9121879874e20 to your computer and use it in GitHub Desktop.
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 redirectDefault(url, urls) { | |
var iframe = document.createElement("iframe"); | |
iframe.style.border = "none"; | |
iframe.style.width = "1px"; | |
iframe.style.height = "1px"; | |
iframe.onload = function() { | |
redirect(redirectDefault, urls); | |
}; | |
iframe.src = url; | |
// If we're still loading the document, wait before doing this | |
ensureLoadedThen(function() { | |
document.body.appendChild(iframe); | |
}); | |
} | |
function redirectWeb() { | |
window.location = urls[urls.length - 1]; | |
} | |
if (!checkAlreadyInvoked()) { | |
invoke(); | |
} | |
function checkAlreadyInvoked() { | |
var invokedCookie = "fb45d8cf63156e060cd952e5a2576f41" + "_invoked"; | |
if (document.cookie.indexOf(invokedCookie + "=") !== -1) { | |
return true; | |
} else { | |
document.cookie = invokedCookie + "=true; expires=" + new Date(Date.now() + 300000).toGMTString(); | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment