thundird Extensio - getting to parent windows' element - Mozilla

This is a discussion on thundird Extensio - getting to parent windows' element - Mozilla ; Hi all I am writing an extension that adds a statusbarpanel on the main window. A new window is open up and the user can select a state within this subwindow and I want to update the state of the ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: thundird Extensio - getting to parent windows' element

  1. thundird Extensio - getting to parent windows' element

    Hi all

    I am writing an extension that adds a statusbarpanel on the main
    window. A new window is open up and the user can select a state
    within this subwindow and I want to update the state of the parent's
    statusbarpanel based on what the use select.

    I have tried a few things to get a reference to the statusbarpanel but
    nothing has worked so far:

    var mainWindow = window.parent
    var icon = mainWindow.document.getElementById("vacationStatus");

    or

    var mainWindow =
    window.QueryInterface(Components.interfaces.nsIInt erfaceRequestor)
    .getInterface(Components.interfaces.nsIWebNavigati on)
    .QueryInterface(Components.interfaces.nsIDocShellT reeItem)
    .rootTreeItem
    .QueryInterface(Components.interfaces.nsIInterface Requestor)
    .getInterface(Components.interfaces.nsIDOMWindow)

    var icon = mainWindow.document.getElementById("vacationStatus");

    and the error is always 'icon has no properties'

    what is the proper way to address this?

    thanks

    dickson


  2. Re: thundird Extensio - getting to parent windows' element

    dicksonlaw@gmail.com wrote:

    >var mainWindow = window.parent
    >
    >

    I think you're looking for window.opener

    --
    Warning: May contain traces of nuts.

  3. Re: thundird Extensio - getting to parent windows' element

    On Jul 12, 9:41 pm, Neil wrote:
    > dickson...@gmail.com wrote:
    > >var mainWindow = window.parent

    >
    > I think you're looking for window.opener
    >
    > --
    > Warning: May contain traces of nuts.


    Indeed it works - thanks


+ Reply to Thread