Address Bar Scripts: Examples

Copyright © 2005 by Pteromys Fortissimus.
Permission is granted to mirror this article as-is.
In Address Bar Scripts, I showed you how to use javascript from the address bar, as well as a few specific tricks you could do. For those of you who haven't read that article, the address bar scripts are scripts you type or paste into your browser's address bar to do silly things to the displayed page.
This page lists a few of the more interesting scripts that I've written in the past. You can add them to your favorites/bookmarks for quick access if you like. There's nothing that guarantees they'll work for you, but if they do, you just might find them useful or amusing.

The Scripts

Replaces all words on the page with "meow" or some other word of the user's choice. (Execute on sample text)
javascript:void(document.body.innerHTML = String(document.body.innerHTML).replace(/([^A-Za-z0-9&])[A-Za-z0-9]+(?![^<>]*>)/g, '$1'+prompt('Word?', 'meow')));
Replaces all images on the page with an image of the user's choice. (Execute on whole page)
javascript:void(iy = prompt('Image URL?', '')); for (var ix=0; ix<document.images.length; ix++) {void(document.images[ix].src=iy);}
Inserts "like" or some other word of the user's choice before every word. (Execute on sample text)
javascript:void(document.body.innerHTML=String(document.body.innerHTML).replace(/([^A-Za-z0-9&])([A-Za-z0-9]+)(?!([^<]*>))/g, '$1'+ prompt('Word?','like') + ' $2'));
Translates a webpage from English to Ubbi-dubbi. (Added 2005-09-25.) (Execute on sample text)
javascript:void( document.body.innerHTML = String(document.body.innerHTML).replace(/(([^AEIOUYaeiouy&]|^|[^A-Za-z&][Yy]|^[Yy])([AIOaio]|[Ee](?=[\w])|[Uu](?![Ee]\b))|([^AEIOUQaeiouq&]|^)([Uu][Ee]\b)|([^AEIOUYaeiouy\W])([Yy]|[Ll][Ee][Ss]*[Dd]*\b)|(^[Tt][Hh]|[^A-Za-z&][Tt][Hh])([Ee]))(?![^<]*>)/g, '$2$4$6$8ubb$3$5$7$9' ));
Blinks "MEEP" on the screen without a blink tag.1 (Added 2007-06-05.) (Execute on whole page)
javascript:document.body.innerHTML="<div id='meep' style='text-align:center; font-size:48pt; visibility:visible;'>MEEP</div>"; setInterval("document.getElementById('meep').style.visibility='hidden';", 1000); setTimeout("setInterval(\"document.getElementById('meep').style.visibility='visible';\", 1000);", 500); void 0;
Shifts the page background slowly through a rainbow of colors.1 (Added 2007-06-05.) (Execute on whole page)
javascript:v=5; n=new Array(0x000100*v, -0x010000*v, 0x000001*v, -0x000100*v, 0x010000*v); l=n.length; n[l]=0; for(j=0; j<l; j++) {n[l]-=n[j];} t=0; i=0; c=0x1ff0000; s=0; if(typeof(h)=="number") {clearInterval(h);} h=setInterval("t+=v; if(t>255) {t=v; i++; if(i>l) {i=0;}} c+=n[i]; s=String(Number(c).toString(16)).substr(-6); document.body.style.background='#'+s;", 50); void 0;

Footnotes

  1. Unlikely to work in Internet Explorer 7, due to use of the "setInterval" method.

Sample Text

(reset)
Sample Image The quick brown fox jumps over the lazy dog.
Jackdaws love my big sphinx of quartz.
A Winner Is You.