1. 程式人生 > >黑科技小代碼

黑科技小代碼

shu des contex 如果 進行 position coo bsp gda

一.神奇的JS代碼

在地址欄中輸入任意網站,然後用javascript:{document.body.contentEditable=‘true‘; document.designMode=‘on‘; void 0}
替換地址欄中域名,回車就可以在IE中重新布局當前網站。

找一個有圖片的網站,用

javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI=document.images; DIL=DI.length; function A(){for(i=0; i-DIL; i++){DIS=DI[ i ].style; DIS.position=‘absolute‘; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval(‘A()‘,5); void(0);

替換地址,神奇的效果出現了。。

以下代碼是解除禁止右鍵,禁止復制之類的功能!


javascript:document.oncontextmenu = ‘‘;document.onmousedown = ‘‘;document.ondragstart = ‘‘; document.onselectstart = ‘‘;document.onselect = ‘‘; document.oncopy = ‘‘;document.onbeforecopy = ‘‘; document.onmousemove = ‘‘; void 0

下代碼是把隱藏的表單顯示出來!

javascript:for(i=0;i<document.all.length;i++){document.body.all[i].maxLength=2147483647;document.body.all[i].outerHTML =document.body.all[i].outerHTML.replace(/type=(radio)|(hidden)|(checkbox)/i,‘type=text‘);}void 0

2.獲知詳細的URL信息

javascript:alert("The actual URL is:\t\t" + location.protocol + "//" + location.hostname + "/" + "\nThe address URL is:\t\t" + location.href + "\n" + "\nIf the server names do not match, this may be a spoof.");

將實際 URL 與地址欄中的 URL 進行比較。如果它們不相符,則該 Web 站點有可能是在謊報。在這種情況下,您可能需要關閉 Internet Explorer。

3.用IE做簡單計算

在地址欄中輸入“javascript:alert(1.2*50+50*3/10) ”,然後把IE的地址欄替換成如下代碼:

4.顯示網頁源代碼(對於加密過的可以直接顯示其加密前的源代碼)

javascript:s=document.documentElement.outerHTML;document.write(‘‘);document.body.innerText=s

5.網頁放大1.5倍

javascript:void(s=document.body.style);void(z=s.getAttribute(‘zoom‘));if(z){s.setAttribute(‘zoom‘,(parseInt(z)+50)+‘%‘);}else s.setAttribute(‘zoom‘,‘150%‘)

6.網頁縮小0.5倍

javascript:void(s=document.body.style);void(z=s.getAttribute(‘zoom‘));if(z){s.setAttribute(‘zoom‘,(parseInt(z)-50)+‘%‘);}else s.setAttribute(‘zoom‘,‘50%‘)

7. 顯示網頁中除圖片的其他

javascript:for(jK6bvW=0;jK6bvW<document.images.length;jK6bvW++){void(document.images[jK6bvW].style.visibility=‘hidden‘)}

8.解除網頁中的一些禁止功能 如復制/粘貼,右鍵等
javascript:(function(e,f,w,d,b,i){for(i=0;i<e.length;)(t=e[i++],w[t]=d[t]=b[t]=f);})([‘onmousedown‘,‘onmouseup‘,‘onmousemove‘,‘ondblclick‘,‘onclick‘,‘oncontextmenu‘,‘onmousewheel‘,‘onselectstart‘,‘oncopy‘,‘onkeydown‘,‘onkeypress‘,‘onkeyup‘],new Function,window,document,document.body);

9.屏幕晃動
javascript:function flood(n) {if (self.moveBy) {for (i = 200; i > 0;i--){for (j = n; j > 0; j--) {self.moveBy(1,i); self.moveBy(i,0);self.moveBy(0,-i); self.moveBy(-i,0); } } }}flood(6);{ var inp = "D-X !msagro na dah tsuj resworb rouY"; var outp = ""; for (i = 0; i <= inp.length; i++) {outp =inp.charAt (i) + outp ; } alert(outp) ;}; reverse

10.網頁射擊遊戲
javascript:var%20s%20=%20document.createElement(‘script‘);s.type=‘text/javascript‘;document.body.appendChild(s);s.src=‘http://erkie.github.com/asteroids.min.js‘;void(0);
這個遊戲可以在任何網頁裏面玩,可以把圖片和文字打掉,如圖圈內三角形是發射器,加載右下角黑窗口後,按F開始遊戲,方向鍵控制移動,空格鍵射擊。

11.顯示當前網頁的COOKIE
javascript:alert(document.cookie)

12.顯示網頁中所有圖片

javascript:Ai7Mg6P=‘‘;for%20(i7M1bQz=0;i7M1bQz<document.images.length;i7M1bQz++){Ai7Mg6P+=‘<img%20src=‘+document.images[i7M1bQz].src+‘><br>‘};if(Ai7Mg6P!=‘‘){document.write(‘<center>‘+Ai7Mg6P+‘</center>‘);void(document.close())}else{alert(‘No%20images!‘)}

Source Link: http://blog.csdn.net/sjrGCkym/article/details/78266232

黑科技小代碼