[Project_owners] Calling JS functions in browser windows from dialogs

Jeroen Groenenboom jagrboom at zonnet.nl
Tue Mar 28 00:09:01 EST 2006

It seems to me that if there's no navigator window, your extension 
(whatever it is) is probably of no use either (or just let your 
extension fail). Although it's just an educated guess, I think this is 
what you want:

an overlay of browser.xul:

<overlay id="myOverlay" 
    <script type="application/x-javascript" 

and in quickDialog.js:

function myGetNavigatorWindow() {
    .getService( Components.interfaces.nsIWindowMediator )
    .getMostRecentWindow( "navigator:browser" );

var navigatorWindow = myGetNavigatorWindow();

>>>>>This won't work if there are no navigator windows working. 
>>>>Correct, and that is why I check for chrome windows first (this will 
>>>>open a new window when needed) but what I want is in function for all JS 
>>>>functions that I need from that chrome window.

More information about the Project_owners mailing list