是否可以制作一个在网站更改时创建警报的书签?

问题描述

我最近发现了书签是什么,我立刻就感兴趣了。我想知道是否有一种方法可以在网站更改时发出警报(当讨论论坛中有新的未读或新主题时,或者当我在 https://mail.google.com/ 上收到电子邮件时)。我不能使用通知。这是我尝试过的:

javascript:(function(){ var xmlHttp = getXMLHttpObj(); if(xmlHttp == null){ alert('Failed to load XMLHTTP'); return; } var actual = getPageContent(xmlHttp,window.location.href); var intervalId = window.setInterval(function(){ var current = getPageContent(xmlHttp,window.location.href); if(actual != current){ alert('This page has been modified since you opened it'); window.clearInterval(intervalId); } },1000); function getPageContent(xmlHttp,url){ xmlHttp.open('GET',window.location.href,false); xmlHttp.send(''); return xmlHttp.responseText; } function getXMLHttpObj(){ if(typeof(XMLHttpRequest)!='undefined') return new XMLHttpRequest(); var axO=['Msxml2.XMLHTTP.6.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP','Microsoft.XMLHTTP']; for(var i = 0; i < axO.length; i++){ try{ return new ActiveXObject(axO[i]); }catch(e){} } return null; }})()

有可能吗,如果有,怎么做?另外,是否可以更改网站图标而不是警报?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)