1

Is there a way I can use the chrome.downloads API to download the HTML content of a web page? Basically what I need to do is download a text/HTML file which contains all the content between the <html> </html> tags, essentially uisng the following line of code:

var HTMLContent = document.getElementsByTagName('html')[0].innerHTML;

Ideally, I would create a text file which contains the rest of the HTML code and download that file. Can this be done with the chrome.downloads API? Or this there some better alternative?

I excuse myself if this is a completely obvious question... This is the first chrome extension I am writing.

Katia Abela
  • 271
  • 7
  • 17
  • 3
    The `chrome.downloads` API downloads a single resource only. If you want to save a complete web page, try to using `chrome.pageCapture.saveAsMHTML` and follow up this link: http://stackoverflow.com/questions/24672190/can-we-download-a-webpage-completely-with-chrome-downloads-download-google-chr?rq=1 – Dayton Wang Feb 18 '15 at 18:10

0 Answers0