September 22, 2023, 11:22:35 AM

Author Topic: Javascript in Firefox  (Read 6080 times)

0 Members and 1 Guest are viewing this topic.

Offline benthehutt

  • Global Moderator
  • Seasoned Poster
  • *****
  • Posts: 368
  • Country:
  • "Drugs? You'd better not be!" - my mom
    • Echelon9
Javascript in Firefox
« on: September 21, 2005, 12:15:59 AM »
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:

Code: [Select]
//Tells you the exact date that the webpage was last modified

//Tells you what window opened up the current window

//returns domain name

//returns 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.