Interface for persisting DOM documents and URIs to local or remote storage. @status UNDER_REVIEW
[scriptable, uuid(dd4e0a6a-210f-419a-ad85-40e8543b9465)]
Constants
Only use cached data (could result in failure if data is not cached). */
Ignore any redirected data (usually adverts). */
Do not run the incoming data through a content converter e.g. to decompress it */
Replace existing files on the disk (use with due diligence!) */
Make changes to original dom rather than cloning nodes */
Fix links relative to destination location (not origin) */
Force serialization of output (one file at a time; not concurrent) */
Don't make any adjustments to filenames */
Automatically cleanup after a failed or cancelled operation, deleting all created files and directories. This flag does nothing for failed upload operations to remote servers.
Let the WebBrowserPersist decide whether the incoming data is encoded and whether it needs to go through a content converter e.g. to decompress it.
Output only the current selection as opposed to the whole document. */
For plaintext output. Convert html to plaintext that looks like the html. Implies wrap (except inside <pre>), since html wraps. HTML output: always do prettyprinting, ignoring existing formatting.
Output without formatting or wrapping the content. This flag may be used to preserve the original formatting as much as possible.
Wrap even if when not doing formatted output (e.g. for text fields). */
For plaintext output. Output for format flowed (RFC 2646). This is used when converting to text for mail sending. This differs just slightly but in an important way from normal formatted, and that is that lines are space stuffed. This can't (correctly) be done later.
Convert links to absolute links where possible. */
Attempt to encode entities standardized at W3C (HTML, MathML, etc). This is a catch-all flag for documents with mixed contents. Beware of interoperability issues. See below for other flags which might likely do what you want.
Output with carriage return line breaks. May also be combined with ENCODE_FLAGS_LF_LINEBREAKS and if neither is specified, the platform default format is used.
Output with linefeed line breaks. May also be combined with ENCODE_FLAGS_CR_LINEBREAKS and if neither is specified, the platform default format is used.
For plaintext output. Output the content of noscript elements. */
For plaintext output. Output the content of noframes elements. */
Encode basic entities, e.g. output instead of character code 0xa0. The basic set is just & < > " for interoperability with older products that don't support α and friends.
Encode Latin1 entities. This includes the basic set and accented letters between 128 and 255.
Attributes
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.
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 @see nsIInterfaceRequestor
Methods
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.
Save a channel to a file. It must not be opened yet. @see saveURI
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!
@param aDocument Document to save to file. Some implementations of
this interface may also support <CODE>nsnull</CODE>
to imply the currently loaded document.
@param aFile Target local file. This may be a nsILocalFile object or an
nsIURI object with a file scheme or a scheme that
supports uploading (e.g. ftp).
@param aDataPath Path to directory where URIs linked to the document
are saved or nsnull if no linked URIs should be saved.
This may be a nsILocalFile object or an nsIURI object
with a file scheme.
@param aOutputContentType The desired MIME type format to save the
document and all subdocuments into or nsnull to use
the default behaviour.
@param aEncodingFlags Flags to pass to the encoder.
@param aWrapColumn For text documents, indicates the desired width to
wrap text at. Parameter is ignored if wrapping is not
specified by the encoding flags.
@see nsILocalFile
@see nsIURI
@return NS_OK Operation has been started.
@return NS_ERROR_INVALID_ARG One or more arguments was invalid.
void
saveDocument(in nsIDOMDocument aDocument, in nsISupports aFile, in nsISupports aDataPath, in string aOutputContentType, in unsigned long aEncodingFlags, in unsigned long aWrapColumn)
Save the specified URI to file.
@param aURI URI to save to file. Some implementations of this interface
may also support <CODE>nsnull</CODE> to imply the currently
loaded URI.
@param aCacheKey An object representing the URI in the cache or
<CODE>nsnull</CODE>.
@param aReferrer The referrer URI to pass with an HTTP request or
<CODE>nsnull</CODE>.
@param aPostData Post data to pass with an HTTP request or
<CODE>nsnull</CODE>.
@param aExtraHeaders Additional headers to supply with an HTTP request
or <CODE>nsnull</CODE>.
@param aFile Target file. This may be a nsILocalFile object or an
nsIURI object with a file scheme or a scheme that
supports uploading (e.g. ftp).
@see nsILocalFile
@see nsIURI
@see nsIInputStream
@return NS_OK Operation has been started.
@return NS_ERROR_INVALID_ARG One or more arguments was invalid.
void
saveURI(in nsIURI aURI, in nsISupports aCacheKey, in nsIURI aReferrer, in nsIInputStream aPostData, in string aExtraHeaders, in nsISupports aFile)
Compare to: