[lug] Mozilla toolbar question

Bear Giles bgiles at coyotesong.com
Mon Mar 15 18:45:22 MST 2004


D. Stimits wrote:
> Bear Giles wrote:
> 
>> Has anyone else ever worked on a Mozilla toolbar?  I need to pull data 
>> from the browser window's DOM but can't find it.  (The default DOM is 
>> for the toolbar itself.)  This is a bit frustrating since I can find 
>> the most recently used window to open results in a new tab, but the 
>> DOM associated with that window isn't the broswer window.
>>
> 
> I'm not sure what you're looking for. 

The answer turns out to be

    document.getElementById("content").contentDocument;

 > The DOM Inspector opens in its own
> GUI if you open it from tools, and then you point it at a web page or in 
> File menu open an existing window.

I'm aware of the DOM Inspector, but it's an interactive tool.  I'm 
scripting a toolbar that pulls values from the current browser 
window.  Two different documents, two different DOMs.



More information about the LUG mailing list