Codebox Software

Slightly Evil JavaScript


Here is a collection of JavaScript code which you can use to vanquish your enemies (or at least mildly amuse them). Evilness increases the further down the page you go.

All the scripts are available as bookmarklets - to use them just drag the green boxes into your bookmarks bar, and click the bookmark when you want to activate the script.

Some are also available as User Scripts, which are supported natively in Google Chrome, and can also be used in other browsers with the help of a browser extension (e.g. Greasemonkey for Firefox). The User Script versions have better prank potential, because once installed they will run automatically on every page that the victim visits, whereas the bookmarklets must be manually clicked in order to run.

I have tested these scripts in Google Chrome, Firefox and Safari, they should also work fine in Opera and maybe in Internet Explorer 9 and above.

Flip Page by 180°

This script immediately turns a web page upside down, not too subtle but guaranteed to have an impact.

Bookmarklet: Flip 180 (click the box to try it on this page)

User Script
Source Code

Flip all Images

This script turns every image on the page upside-down.

Bookmarklet: Flip Images (click the box to try it on test image below)

test owl

User Script
Source Code

Random Orientations

This script makes small adjustments to the orientation of various elements on the page, giving it a nice 'broken' look.

Bookmarklet: Random Orientations (click the box to try it on this page)

User Script
Source Code

The Bieberfier

Replaces all images on the page with a picture of teen heartthrob Justin Bieber

Bookmarklet: The Bieberfier (click the box to try it on this page)

User Script
Source Code

Rotate Page Booby Trap

This script does nothing until someone presses a key on keyboard or moves the mouse, then it rotates the page 180°. After you run the script there is a 5 second pause before the trap is activated.

Bookmarklet: Rotate Page Booby Trap (click the box to try it on this page)

Source Code

I Like Frogs

This script replaces any text that the victim enters with the words 'I like frogs'

Bookmarklet: I like frogs (click the box to try it on this page)

User Script
Source Code