无需插件 chrome浏览器在Console中网页自动刷新页面的Javascript代码

  • 打开网页后,按F12打开调试工具栏
  • 选择“控制台”,黏贴如下代码后,按回车。
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()) };
}
  • 输入自动刷新的时间间隔(单位秒),即可实现自动刷新,直到你关掉页面或者手工刷新界面为止。

评论

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注