Interface nsIWindowProviderType

The nsIWindowProvider interface exists so that the window watcher's default behavior of opening a new window can be easly modified. When the window watcher needs to open a new window, it will first check with the nsIWindowProvider it gets from the parent window. If there is no provider or the provider does not provide a window, the window watcher will proceed to actually open a new window.

Hierarchy

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

  • A method to request that this provider provide a window. The window returned need not to have the right name or parent set on it; setting those is the caller's responsibility. The provider can always return null to have the caller create a brand-new window.

    Returns

    A window the caller should use or null if the caller should just create a new window. The returned window may be newly opened by the nsIWindowProvider implementation or may be a window that already existed.

    Throw

    NS_ERROR_ABORT if the caller should cease its attempt to open a new window.

    See

    • nsIWindowWatcher for more information on aFeatures.
    • nsIWebBrowserChrome for more information on aChromeFlags.

    Parameters

    • aOpenWindowInfo: nsIOpenWindowInfo

      Must not be null. This is the information the caller wants to be used to construct the new window.

    • aChromeFlags: number

      The chrome flags the caller will use to create a new window if this provider returns null. See nsIWebBrowserChrome for the possible values of this field.

    • aCalledFromJS: boolean
    • aURI: nsIURI

      The URI to be loaded in the new window (may be NULL). The nsIWindowProvider implementation must not load this URI into the window it returns. This URI is provided solely to help the nsIWindowProvider implementation make decisions; the caller will handle loading the URI in the window returned if provideWindow returns a window.

      When making decisions based on aURI, note that even when it's not null, aURI may not represent all relevant information about the load. For example, the load may have extra load flags, POST data, etc.

    • aName: string

      The name of the window being opened. Setting the name on the return value of provideWindow will be handled by the caller; aName is provided solely to help the nsIWindowProvider implementation make decisions.

    • aFeatures: string

      The feature string for the window being opened. This may be empty. The nsIWindowProvider implementation is allowed to apply the feature string to the window it returns in any way it sees fit. See the nsIWindowWatcher interface for details on feature strings.

    • aForceNoOpener: boolean
    • aForceNoReferrer: boolean
    • aIsPopupRequested: boolean

      True if this window is opened by window.open with requesting a popup window. This doesn't necessarily mean whether the actual window is shown as minimal popup or not.

    • aLoadState: nsDocShellLoadStatePtr

      Specify setup information of the load in the new window

    • aWindowIsNew: boolean

      [out] Whether the window being returned was just created by the window provider implementation. This can be used by callers to keep track of which windows were opened by the user as opposed to being opened programmatically. This should be set to false if the window being returned existed before the provideWindow() call. The value of this out parameter is meaningless if provideWindow() returns null.

    Returns BrowsingContext

Generated using TypeDoc