Interface nsIBrowserDOMWindowType

The C++ source has access to the browser script source through nsIBrowserDOMWindow. It is intended to be attached to the chrome DOMWindow of a toplevel browser window (a XUL window). A DOMWindow that does not happen to be a browser chrome window will simply have no access to any such interface.

Hierarchy

Properties

tabCount: number

The number browser tabs in the window. This number currently includes lazy tabs, though for most uses it probably should not.

Methods

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • This function is responsible for calling nsIContentViewer::PermitUnload on each frame in the window. It returns true if closing the window is allowed. See canClose() in BrowserUtils.sys.mjs for a simple implementation of this method.

    Returns boolean

  • Create the content window for the given URI.

    Returns

    the window into which the URI would have been opened.

    Parameters

    • aURI: nsIURI

      the URI to be opened in the window (can be null).

    • aOpenWindowInfo: nsIOpenWindowInfo

      info about the creation (can be null).

    • aWhere: number

      see possible values described above.

    • aFlags: number

      flags which control the behavior of the load. The OPEN_EXTERNAL/OPEN_NEW flag is only used when aWhere == OPEN_DEFAULTWINDOW.

    • aTriggeringPrincipal: nsIPrincipal

      the principal that would trigger the potential load of aURI.

    • aCsp: nsIContentSecurityPolicy

      the CSP to use (if any) for the new window.

    Returns BrowsingContext

  • As above, but return the nsFrameLoaderOwner for the new window. Value is returned as Element, QI'd back to nsFrameLoaderOwner as needed.

    Additional Parameters:

    Returns

    The frame element for the newly opened window.

    Parameters

    • aURI: nsIURI
    • params: nsIOpenURIInFrameParams
    • aWhere: number
    • aFlags: number
    • aName: string

      The name to give the window opened in the new tab.

    Returns Element

  • Load a URI.

    Returns

    the window into which the URI was opened.

    Parameters

    • aURI: nsIURI

      the URI to open. null is not allowed. To create the window without loading the URI, use createContentWindow instead.

    • aOpenWindowInfo: nsIOpenWindowInfo

      info about the open (can be null).

    • aWhere: number

      see possible values described above.

    • aFlags: number

      flags which control the behavior of the load. The OPEN_EXTERNAL/OPEN_NEW flag is only used when aWhere == OPEN_DEFAULTWINDOW.

    • aTriggeringPrincipal: nsIPrincipal

      the principal that triggered the load of aURI.

    • aCsp: nsIContentSecurityPolicy

      the CSP to be applied to the new load.

    Returns BrowsingContext

  • As above, but return the nsFrameLoaderOwner for the new window. Value is returned as Element, QI'd back to nsFrameLoaderOwner as needed.

    Additional Parameters:

    Returns

    The frame element for the newly opened window. // XXXbz is this the right API? // See bug 537428

    Parameters

    • aURI: nsIURI
    • params: nsIOpenURIInFrameParams
    • aWhere: number
    • aFlags: number
    • aName: string

      The name to give the window opened in the new tab.

    Returns Element

Generated using TypeDoc