可是那些破站点让人太郁闷了...不是弹出广告,就是满屏幕飘浮动广告....气死我了...
所以做了一个超简陋的浏览器,把页面中的JS基本上全禁掉了(禁用JS的正则不是很好,此外CSS里的没禁掉,不过目前反正够俺用就好了),顺便把iframe也全部干掉
还可以自动记得上次浏览的页面,打开就直接进入,看书的时候就不怕打断了
因为超简陋,所以连表单也不支持,只支持链接,哈哈,看书倒是够用了....
代码中的伪session处理和俺自己封装的xmlhttp值得一看
不能直接运行,保存到本地,另存为HTA使用,哈哈
代码如下:
<head>
<title>BookViewer</title>
<metahttp-equiv="content-type"content="text/html;charset=UTF-8"/>
<style>
body{margin:0px;padding:0px;overflow:auto;border-style:none;font-size:12px;background-color:buttonface;}
iframe{width:100%;border-style:none;position:absolute;top:25px;}
#i1{height:22px;line-height:18px;width:100%;border:1pxsolid#666;margin:0px2px;padding:0px10px;}
</style>
<script>
strSessionName="bookviewer_lastURL";
lastURL="";
xp=newxmlhttp();
functioncheckMe(){
if(i1.value!=lastURL){
lastURL=i1.value;
session_set(strSessionName,lastURL);
}
try{
for(vari=0;i<f1.document.links.length;i++)f1.document.links[i].onclick=n0;
}catch(e){}
if(/book/.5seecn/i.test(lastURL))f1.document.body.onkeydown=chkKey;
}
functionchkKey(){
varallLinks;
if(f1.event.keyCode==39){
allLinks=f1.document.links;
for(vari=0;i<allLinks.length;i++)if(/下一页/.test(allLinks[i].innerHTML)){
i1.value=allLinks[i].href;n2();return;
}
}elseif(f1.event.keyCode==37){
allLinks=f1.document.links;
for(vari=0;i<allLinks.length;i++)if(/上一页/.test(allLinks[i].innerHTML)){
i1.value=allLinks[i].href;n2();return;