I'm making a chrome extension whose sole purpose is to prevent session timeout.For that I'm using this command:
setInterval(function(){ location.reload(); }, 10000);
What I'm expecting is a page refresh for every 10 seconds which is not happening. But when I write this :
setInterval(function(){ alert("Hello"); }, 3000);
It is showing hello for every 3 seconds where as setInterval(function(){ location.reload(); }, 10000);
is refreshing page just for one time after ten minutes.
What might be the error in this ?
location.reload()
is a browser refresh; the old page is discarded, along with its running JavaScript. – Ultimogeniture