chrome浏览器网页自动刷新的console代码,无需插件

作者: 龙哥 分类: 技术 发布时间: 2023-02-07 21:05 ė2,313 次浏览

代码使用说明:
代码直接贴到chrome或者firefox的控制台中,输入自动刷新的时间间隔(单位秒),即可实现自动刷新,直到你关掉页面或者手工刷新界面为止。

代码:

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())};
}

 

本文出自 俞凌龙博客,转载时请注明出处及相应链接。

本文永久链接: https://blog.jlwz.cn/376

Ɣ回顶部