To begin with, it can't be done without touching the original page. The way the script works, it edits the current page (so image urls continue to work, etc). The best you could do would be to store the innerHTML
of the root html
and then restore it after you have grabbed the content (or store the head
and body
separately) It would look something like this:
- First you would need to store the existing
innerHTML
of the html
element.
- Next, you would have the script run as needed, just remove the readability-controls part.
- Get the HTML contents of either the
readability-content
or the whole document and store it in a variable.
- Restore the original content using the content stored in step 1 (so the page goes back to how it was before)
At this point, depending on your browser, you could either try to use a dataURI or you could dynamically add a reference to the Downloadify library, images, etc and add the download button to the page. Finally, clicking the "Download" button you could pre-supply the filename and the data stored in step 3, but the location would have to be selected every time.
Sorry this is so hypothetical, but it would take quite a bit of work to put this together.