How to schedule IE page reload

前端 未结 4 2067
遇见更好的自我
遇见更好的自我 2021-01-17 03:45

Is there a mechanism i can use to force page reload every \'n\' minutes? I can\'t modify the page code itself, \"refresh\" request should be issued from outside of the page

4条回答
  •  北荒
    北荒 (楼主)
    2021-01-17 04:35

    var timedRefresh = setTimeout(function(){location.reload(true)},1*60000)
    

    That will refresh the page every minute. If you make it into a script for greasemonkey it will continually be injected into the page and keep executing every minute + load time.

    ANother way is to, as suggested, put the page in an iframe. e.g.

    if (self == top){
    document.body.innerHTML = '