3

I've just entered a load of data into a site that I'm testing. I don't want to enter it again, but want to go for lunch, and the session will have expired by the time I get back.

A bookmarklet would be handy (as this situation occurs often) to keep refreshing the page, every minute or so.

Any ideas?

Thanks.

2 Answers2

6

This bookmarklet reloads the page every 5min, almost certainly keeping the session active as if you had just opened a new tab; the trick is to reload the page in a separate window/tab as follows.

javascript:_x=setInterval(function(){open(location.href, 'otherWindow')}, 1000*60*5)

You will have to disable your popup blocker / allow the first window to open. Obviously only one new window is created, else this would be a terrible solution.

To test this, merely replace 1000*60*5 with something like 1000*5 (5 seconds).


The user didn't really need it for his use case, but if someone else wants to avoid closing the page, you can just use this bookmarklet to stop the refreshing.

javascript:clearInterval(_x)
ninjagecko
  • 88,546
  • 24
  • 137
  • 145
  • That won't work, because the page refreshes and loses the interval =) Little bit too simple – Rudie May 12 '11 at 11:28
  • Your comment is completely incorrect, note that it opens in a **new window**. That is the entire idea behind this answer, as stated. – ninjagecko May 12 '11 at 11:31
  • And when you close the original window (you will), the interval stops... Right? – Rudie May 12 '11 at 12:00
  • If the user chooses to close the window when they get back from lunch (not sure why you are so insistent "**you will**"), then yes, the other page will stop refreshing. If you have any further questions you are welcome to use the script yourself; this question could have easily been answered by copy-pasting. – ninjagecko May 12 '11 at 13:48
5

Use the ReloadEvery plugin to Firefox.

Kenny Eliasson
  • 2,047
  • 15
  • 23