Using the TabMixPlus plugin for Firefox or Chrome, I can right click a page and choose "reload every..." and I could choose an interval.
I'd prefer not to install a plugin unless I really have to, and I am aware that you can type special things into Chrome's address bar.
This makes me think that something like this typed straight into the address might work:
javascript:setInterval(window.location.reload(), 2000); //2 secs`
I haven't managed it yet, but still don't want to rule it out as a possibility.
Is this possible?
Answer
After 6 years I have a solution for this!
The answer is inspired by the other answers here.
Edub's answer didn't work for me, it reloaded the page over and over, and didn't observe setInterval
's duration parameter. I don't understand why Edub's answer doesn't work as expected.
This works for me in Chrome 67:
javascript:document.getElementsByTagName("body")[0].innerHTML = "
Formatted version:
document.getElementsByTagName("body")[0].innerHTML =
" src=\"" + window.location.toString() + "\"
style=\"position: absolute; top:0; left:0; right:0; bottom:0; width:100%; height:100%;\">
<\/iframe>";
reloadTimer = setInterval(
function(){
document.getElementById("testFrame").src=document.getElementById("testFrame").src
},
10000
)
This works by replacing the current document body with an iframe pointing to the window's current location.
Then a call to setInterval is made, that makes the page reload on a timer.
This works well as a bookmark. setInterval's complementary function can be called by bookmark too: javascript:clearTimer(reloadTimer)
Notes:
Some sites detect they are being accessed via iframe and attempt to prevent access (Stack sites for instance!)
Browsers strip the prefix
javascript:
when pasting into the address bar so it has to be entered manually. Howeverjavascript:
is not stripped if entered via bookmark.
Comments
Post a Comment