Last active
May 27, 2016 20:52
-
-
Save jdnichollsc/f4feaa0de7567a315fab6609fc0b64e3 to your computer and use it in GitHub Desktop.
Repeat HTTP request removing cookies and localStorage
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
var foo = function(){ | |
//Clear cookies | |
var cookies = document.cookie.split(";"); | |
for (var i = 0; i < cookies.length; i++) { | |
var cookie = cookies[i]; | |
var eqPos = cookie.indexOf("="); | |
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie; | |
document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; | |
} | |
console.log(localStorage); | |
var clearStorage = function(){ | |
//Clear localStorage | |
localStorage.clear() | |
}; | |
clearStorage(); | |
//Load iframe | |
document.body.innerHTML='<iframe src="https://channel9.msdn.com/Blogs/Azure-Support-Spain/Azure-ASM-vs-ARM/player#autoplay" width="960" height="540" allowFullScreen frameBorder="0"></iframe>'; | |
//Execute again in 17 minutes | |
setTimeout(foo, 960000); | |
}; | |
foo(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment