4

I am working on a Chrome extension, and an important function of it is: when a new tab created, this extension will "save" the whole web page to the hard disk automatically. Just like the built-in "save as" function of Chrome.

I did not get an answer from google for this topic. Would someone please tell me how to do that. It would be better to offer some examples.

Vikas Sachdeva
  • 5,633
  • 2
  • 17
  • 26
fetag
  • 174
  • 1
  • 12
  • Like you want to save the whole page as HTML, CSS and JS? Or as an image? – Webbanditten Mar 30 '17 at 13:38
  • Yes, exactly. There are some download links in the web page which would send to customers. So I prefer to save and forward the original HTML page, instead of image or pdf. – fetag Mar 30 '17 at 13:41
  • http://stackoverflow.com/questions/4911338/tools-to-selectively-copy-htmlcssjs-from-existing-sites – daan.desmedt Mar 30 '17 at 13:50
  • 1
    See [chrome.pageCapture](https://developer.chrome.com/extensions/pageCapture) API. – wOxxOm Mar 30 '17 at 19:47

1 Answers1

3

You can use chrome.pageCapture API to save the page (along with contents such as image, css, scripts) as MHTML file to disk.

See https://developers.chrome.com/extensions/pageCapture

Chang
  • 1,163
  • 9
  • 14