Interface nsIWebBrowserPersistType

Interface for persisting DOM documents and URIs to local or remote storage.

Hierarchy

Properties

currentState: number

Current state of the persister object.

persistFlags: number

Flags governing how data is fetched and saved from the network. It is best to set this value explicitly unless you are prepared to accept the default values.

progressListener: nsIWebProgressListener

Callback listener for progress notifications. The object that the embbedder supplies may also implement nsIInterfaceRequestor and be prepared to return nsIAuthPrompt or other interfaces that may be required to download data.

See

  • nsIAuthPrompt
  • nsIInterfaceRequestor
result: number

Value indicating the success or failure of the persist operation.

Throws

NS_BINDING_ABORTED Operation cancelled.

Throws

NS_ERROR_FAILURE Non-specific failure.

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

  • Call this method to request that this object abort whatever operation it may be performing.

    Parameters

    • aReason: number

      Pass a failure code to indicate the reason why this operation is being canceled. It is an error to pass a success code.

    Returns void

  • Cancels the current operation. The caller is responsible for cleaning up partially written files or directories. This has the same effect as calling cancel with an argument of NS_BINDING_ABORTED.

    Returns void

  • Save a channel to a file. It must not be opened yet.

    See

    saveURI

    Parameters

    • aChannel: nsIChannel
    • aFile: nsISupports

    Returns void

  • Save the specified DOM document to file and optionally all linked files (e.g. images, CSS, JS & subframes). Do not call this method until the document has finished loading!

    See

    • nsIWebBrowserPersistDocument
    • WebBrowserPersistable
    • nsIFile
    • nsIURI

    Throws

    NS_ERROR_INVALID_ARG One or more arguments was invalid.

    Parameters

    • aDocument: nsISupports

      Document to save to file. Some implementations of this interface may also support nullptr to imply the currently loaded document. Can be an nsIWebBrowserPersistDocument or Document.

    • aFile: nsISupports

      Target local file. This may be a nsIFile object or an nsIURI object with a file scheme or a scheme that supports uploading (e.g. ftp).

    • aDataPath: nsISupports

      Path to directory where URIs linked to the document are saved or nullptr if no linked URIs should be saved. This may be a nsIFile object or an nsIURI object with a file scheme.

    • aOutputContentType: string

      The desired MIME type format to save the document and all subdocuments into or nullptr to use the default behaviour.

    • aEncodingFlags: number

      Flags to pass to the encoder.

    • aWrapColumn: number

      For text documents, indicates the desired width to wrap text at. Parameter is ignored if wrapping is not specified by the encoding flags.

    Returns void

  • Save the specified URI to file.

    See

    • nsIFile
    • nsIURI
    • nsIInputStream

    Throws

    NS_ERROR_INVALID_ARG One or more arguments was invalid.

    Parameters

    • aURI: nsIURI

      URI to save to file. Some implementations of this interface may also support nullptr to imply the currently loaded URI.

    • aTriggeringPrincipal: nsIPrincipal

      The triggering principal for the URI we're saving.

    • aCacheKey: number

      The necko cache key integer.

    • aReferrerInfo: nsIReferrerInfo

      The referrer info for compute and send referrer via HTTP Referer header.

    • aCookieJarSettings: nsICookieJarSettings

      The cookieJarSettings for the HTTP channel which is saving the URI.

    • aPostData: nsIInputStream

      Post data to pass with an HTTP request or nullptr.

    • aExtraHeaders: string

      Additional headers to supply with an HTTP request or nullptr.

    • aFile: nsISupports

      Target file. This may be a nsIFile object or an nsIURI object with a file scheme or a scheme that supports uploading (e.g. ftp).

    • aContentPolicyType: nsContentPolicyType

      The type of content we're saving.

    • aIsPrivate: boolean

      Treat the save operation as private (ie. with regards to networking operations and persistence of intermediate data, etc.)

    Returns void

Generated using TypeDoc