浮動廣告阻擋法
Thursday, 4. October 2007, 01:21:25
把這兩個javascript code加到書簽,開啟要看的網頁,按一下這個書簽就能看到有那些JS。
javascript:s=document.getElementsByTagName('SCRIPT'); d=window.open().document; /*140681*/d.open();d.close(); b=d.body; function trim(s){return s.replace(/^\s*\n/, '').replace(/\s*$/, ''); }; function add(h){b.appendChild(h);} function makeTag(t){return document.createElement(t);} function makeText(tag,text){t=makeTag(tag);t.appendChild(document.createTextNode(text)); return t;} add(makeText('style', 'iframe{width:100Qeight:18em;border:1px solid;')); add(makeText('h3', d.title='Scripts in ' + location.href)); for(i=0; i<s.length; ++i) { if (s[i].src) { add(makeText('h4','script src="' + s[i].src + '"')); iframe=makeTag('iframe'); iframe.src=s[i].src; add(iframe); } else { add(makeText('h4','Inline script')); add(makeText('pre', trim(s[i].innerHTML))); } } void 0
javascript:var MTl=document.getElementsByTagName('SCRIPT');for(var MTi=0,MTr,MTa=[];MTl[MTi];MTi++){if(MTr=MTl[MTi].getAttribute('src')){MTa[MTa.length]=MTl[MTi];}}if(!MTa.length){alert('This page does not use any linked scripts');}else if(MTa.length==1){void(window.open(MTa[0].src));}else{var MTw=window.open('');MTw.document.open();MTw.document.write('<!DOCTYPE HTML PUBLIC \'-//W3C//DTD HTML 4.01//EN\'><html dir=\'ltr\' lang=\'en\'><head><title>External Scripts</title><link rel=\'stylesheet\' href=\'http://my.opera.com/GreyWyvern/homes/files/dir.css\' media=\'screen,projection,tv,handheld,print,speech\'></head><body><h1>External Scripts</h1><h2>'+document.title+'</h2><table><tr><th>Script</th></tr>');for(MTi=0;MTa[MTi];MTi++){MTw.document.write('<tr><td><strong>'+(MTa[MTi].title?MTa[MTi].title:'Untitled')+'</strong><em> <a href=\''+MTa[MTi].src+'\'>'+MTa[MTi].src+'</a><script language=javascript type=\"text\/javascript\" src=\''+MTa[MTi].src+'\'></script></em></td></tr>');}MTw.document.write('</table></body></html>');MTw.document.close();}
這兩個代碼的功能也差不多。上面的能顯示JS的文字內容。上面的只顯示JS連結,但有相關的圖片顯示。























