There seems to be no documentaion whatsoever for building Firefox extensions except for some good ol’ chaps who have put up brilliant tutorials on their weblogs (thanks guys). All I wanted to do was access the current windows DOM from within my extension. But for this trivial task I had to go to the extent of reading source code of various extensions )-:

One of the ways to access the DOM is as follows:

// Get the content of the currently displaying window
var win = window.content;

// Access the document within the window as follows

As easy as that.

  • Equazcion

    I know this is an old post but I wanted to thank you nonetheless. This answers a question I’ve been trying to answer for two days now. There’s absolutely no documentation on this anywhere, at least none that I could find. So, thanks :)

  • Donn Lee

    Ah, such a simple question, and here I finally found the answer. Just starting out in FF extension programming and after viewing the code of lots of fancy toolbars, I gave up and then searched/found this page instead. THANKS

  • Rocker

    Thanks a lot for the above post……. was searching for it for over 2 hrs….

  • Zach Wymer

    I just wanted to say thank you too! It saved me a ton of time finding your post. This is the only link that the great Google provided me that actually helped. Thanks again!

  • gtardini

    Thanks man, you saved me! there is really no documentation out there!

  • Punit


  • Vivek

    Thanks , saved me a lot of time.

  • Yurikolovsky

    Thank you, thank you, thank you!!! such crappy documentation out there still!!