I want to add to one of my extensions a way to replicate the "CTRL+S" functionality.
Behaviour: users surfs to his website, clicks in the extension, the extension needs to do the same as "CTRL+S" functionality, but before it does it I want to add some of my code to the html file.
The CTRL+S does everything great, better then WGET, CURL, HTTRACk and others, i want to mirror the users website in order to make changes in it, and give him a folder with all the new files saved.
Again, I don't want to use wget,curl,httrack and others, just to replicate the CTRL+S functionality, if there's a way to trigger CTRL+S from javascript it will also be great.
For Example there is an extension that does that in firefox, but I want to do it in chrome: https://addons.mozilla.org/en-us/firefox/addon/save-complete-4723/
How to save a web page snapshot with all its elements (css, js, images, ...) into one file
====================================
* Edit: *
I get almost good result with WGET: wget -e robots=off --page-requisites --span-hosts --convert-links --no-directories --directory-prefix=output 'http://example.com' --level=2 --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36"
The problem is that it doesn't wait for the page to load javascript etc, so I want to do it with JS.
PhantomJS didn't gave me good results either, for example: How to save the current webpage with casperjs/phantomjs?
=====================================================
So I thought, maybe an extension will be able to do it? The user will surf to the webpage, and will click on my extension, the extension will save the modified webpage with all of its resources.
===================================================== Again, the perfect result for me is the built in "CTRL+S", if there was a way I can achieve the same results, it would be perfect.