chrome console监控客服回复
背景
二半夜在某服务器网站提交了一个ticket,时间紧迫,我需要第一时间看到对方回复,但我又不想坐在电脑前面干等,如何破?
是不是可以写一个js脚本监控页面内容变动,然后通过某种方式叫醒我?
实现
chrome console里实现自动刷新页面
参考链接1里的方法可以做到了。
timeout=prompt("Set timeout (Second):");
count=0
current=location.href; // 获取当前的URL
if(timeout>0)
setTimeout('reload()',1000*timeout);
else
location.replace(current); // 时间间隔不大于0,仅刷新一次
function reload(){
setTimeout('reload()',1000*timeout); // timeout秒后执行reload函数,实现无限循环刷新
count++;
console.log('每('+timeout+')秒自动刷新,刷新次数:'+count);
fr4me='<frameset cols=\'*\'>\n<frame src=\''+current+'\'/>';
fr4me+='</fr...