Javascript in Firefox

Started by benthehutt, September 21, 2005, 12:15:59 AM

Previous topic - Next topic
A pretty cool function of IE and Firefox is that their address bars can run javascript in them.  Knowing this I just experimented around and wrote a few thing that I now store as bookmarks.  When I want to know a certain thing about a web-page, I just click one of the bookmarks.  Here are a few I've done:


//Tells you the exact date that the webpage was last modified
javascript:alert(document.lastModified);

//Tells you what window opened up the current window
javascript:alert(window.opener);

//returns domain name
javascript:alert(document.domain);

//returns URL
javascript:alert(document.URL);

//resizes window to whatever you specify
javascript:var x = prompt('What x value');var y = prompt('What y value');window.resizeTo(x,y);

//checks to see if web-page uses cookies or not
javascript:if(document.cookie.length = 0){alert("This web-page does not use cookies.");}else{alert("This web-page uses cookies.");}

//goes to element of window history that you select
javascript:h=window.history;var num = prompt('There are elements in your history.  Which one would you like to go to?');h.go(num);


The possibilities are endless!  Maybe...  Either way, this is a great time saver and even gives you info that maybe inaccesible without JS.  Have fun! ;D
Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.

SMF spam blocked by CleanTalk