Search code examples
javascriptgreasemonkeyreload

Greasemonkey script to reload the page every minute


How to reload a page every 60 seconds?

My attempt:

setTimeout (location.reload, 1 * 60 * 60);

I'm not sure what those numbers mean, or how to adapt them to reload after 60 seconds only.


Solution

  • setTimeout(function(){ location.reload(); }, 60*1000);
    

    You have to pass a full function as first argument, and second is the time in millisecond. So in your case, 60 * 1000