Skip to content

Instantly share code, notes, and snippets.

@jdnichollsc
Last active May 27, 2016 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jdnichollsc/f4feaa0de7567a315fab6609fc0b64e3 to your computer and use it in GitHub Desktop.
Save jdnichollsc/f4feaa0de7567a315fab6609fc0b64e3 to your computer and use it in GitHub Desktop.
Repeat HTTP request removing cookies and localStorage
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