Bookmarklet to refresh page every minute or so, so I don't lose session data whilst on lunch

ぃ、小莉子 提交于 2019-12-13 04:18:22

问题


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.


回答1:


Use the ReloadEvery plugin to Firefox.




回答2:


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)


来源:https://stackoverflow.com/questions/5977168/bookmarklet-to-refresh-page-every-minute-or-so-so-i-dont-lose-session-data-whi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!