可是那些破站點讓人太鬱悶了...不是彈出廣告,就是滿屏幕飄浮動廣告....氣死我了...
所以做了一個超簡陋的瀏覽器,把頁面中的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;