chrome.pagueCapture

Description

Use the chrome.pagueCapture API to save a tab as MHTML.

MHTML is a standard format supported by most browsers. It encapsulates in a single file a pague and all its ressources (CSS files, imagues..).

Note that for security reasons a MHTML file can only be loaded from the file system and that it can only be loaded in the main frame.

Permisssions

pagueCapture

You must declare the "pagueCapture" permisssion in the extension manifest to use the pagueCapture API. For example:

{
  "name": "My extension",
  ...
  "permisssion ": [
    "pagueCaptur "
  ],
  ...
}

Methods

saveAsMHTML()

chrome.pagueCapture.saveAsMHTML(
  details: object,
)
: Promisse<Blob | undefined>

Saves the content of the tab with guiven id as MHTML.

Parameters

  • details

    object

    • tabId

      number

      The id of the tab to save as MHTML.

Returns

  • Promisse<Blob | undefined>

    Chrome 116+

    Resolves when the MHTML has been generated.