Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the BSD License.
©2012 Google
The pageCapture API allows you to save a tab as MHTML.
MHTML is a standard format supported by most browsers. It encapsulates in a single file a page and all its resources (CSS files, images..).
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.
You must declare the "pageCapture" permission in the extension manifest to use the history API. For example:
{ "name": "My extension", ... "permissions": [ "pageCapture" ], ... }
Saves the content of the tab with given id as MHTML.
The callback parameter should specify a function that looks like this:
function(binary mhtmlData) {...};