Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to save a page with chrome extension

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.

like image 344
fetag Avatar asked Oct 15 '25 03:10

fetag


1 Answers

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

like image 182
Chang Avatar answered Oct 16 '25 16:10

Chang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!