js

浏览器console控制台自动刷新js代码

Posted by Tesla9527 on August 3, 2021

转载至:https://prodigyu.com/721

浏览器F12打开控制台,粘贴以下代码回车,提示输出刷新的时间间隔就可以开始自动刷新了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
timeout=prompt("Set timeout (Second):");
count=0
current=location.href;
if(timeout>0)
setTimeout('reload()',1000*timeout);
else
location.replace(current);
function reload(){
setTimeout('reload()',1000*timeout);
count++;
console.log('每('+timeout+')秒自动刷新,刷新次数:'+count);
fr4me='<frameset cols=\'*\'>\n<frame src=\''+current+'\'/>';
fr4me+='</frameset>';
with(document){write(fr4me);void(close())};
}