Saturday, April 30, 2011

JavaScript Hacks



Hey, this is my first post . I thought il start out with some insane JavaScript snippets that really kill some time and find a purpose too.
  1. Just copy the code snippets.
  2. Paste in the Address Bar.
   3. Enjoy.
Don't forget to enable javascript in your browser if it isn't already, and save the result to scare some friends. :) 

View Passwords hidden under asterix's yeah!!!


Thats write, you can vies those passwords under them darned asteriskuses or whatever using the next line of code, many thanks for morpheus for this update


javascript:(function(){var s,F,j,f,i; s = ""; F = document.forms; for(j=0; j<F.length; ++j) { f = F[j]; for (i=0; i<f.length; ++i) { if (f[i].type.toLowerCase() == "password") s += f[i].value + "\n"; } } if (s) alert("Passwords in forms on this page:\n\n" + s); else alert("There are no passwords in forms on this page.");})();





Wizard of the Web aka SandBox Editor


This code lets you edit any page/website in real-time :) . You can even edit and save the modified pages to your computer. Very fun piece of code you could use to trick your friends, parents and teachers!! Have fun ツ

javascript:document.body.contentEditable='true'; document.designMode='on'; void 0


Triangle Warrior

Copy paste the following line, and have triagle zip around the browser under your control, destroying page elements at your command, use W, A, D to steer and SPACE to FIRE.
 
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);
Wheel-O-Web



This piece of code strips the page of all its images and starts to rotate them in a circle, more of an oval actually.

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.getElementsByTagName("img"); 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)+"px"; DIS.top=(Math.cos(R*y1+i*y2+y3)*y4+y5)+"px"}R++}setInterval('A()',5); void(0);

Replace the "img" tag with an "a" or  a"p" to make texts and links fly around too. ツ
Test on website with lot of images. Have Fun!!!

The Calculator
Wanna make your browser do some math??? Well punch in any mathematical expression following "javascript:" in the address bar within braces and end of with a ";" and viola ツ

javascript: alert(34343+3434-222);

javascript: alert(10000000000-345345);

You can change the numbers according to your choice and also try creative complex equations. ツ

Finding Spoof Sites
At times everyone of us bumps into those flashy yet sneaky websites that ask a lot more questions than it should. Just use this code whenever in doubt :-

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.");


Baked Browser aka The Serpent
Shakes your fool of a browser so hard that it'l knock some sense into it.
I'll give you two versions of this script, one that goes non stop shakadoo, and the other timed demonstration one

Non-Stop-Shaking

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

Timed Shake

javascript:function Shw(n) {if (self.moveBy) {for (i = 35; 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); } } }} Shw(6)
 
Use it to get at superstitious dumbos. ツ

1 comment: