Interface nsIPrivateBrowsingChannelType

This interface is implemented by channels which support overriding the privacy state of the channel.

This interface must be used only from the XPCOM main thread.

Hierarchy

Properties

isChannelPrivate: boolean

States whether the channel is in private browsing mode. This may either happen because the channel is opened from a private mode context or when the mode is explicitly set with ::setPrivate().

This attribute is equivalent to NS_UsePrivateBrowsing(), but scriptable.

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 used to determine whether the channel's private mode has been overridden by a call to setPrivate. It is intended to be used by NS_UsePrivateBrowsing(), and you should not call it directly.

    Parameters

    • aValue: boolean

      the overridden value. This will only be set if the function returns true.

    Returns boolean

  • Determine whether the channel is tied to a private browsing window.

    This value can be set only before the channel is opened. Setting it after that does not have any effect. This value overrides the privacy state of the channel, which means that if you call this method, then the loadGroup and load context will no longer be consulted when we need to know the private mode status for a channel.

    Note that this value is only meant to be used when the channel's privacy status cannot be obtained from the loadGroup or load context (for example, when the channel is not associated with any loadGroup or load context.) Setting this value directly should be avoided if possible.

    Implementations must enforce the ordering semantics of this function by raising errors if setPrivate is called on a channel which has a loadGroup and/or callbacks that implement nsILoadContext, or if the loadGroup or notificationCallbacks are set after setPrivate has been called.

    Parameters

    • aPrivate: boolean

      whether the channel should be opened in private mode.

    Returns void

Generated using TypeDoc