Google-chrome – How to mirror web page including content generated with JavaScript

firefoxgoogle-chromeweb

As an example, I tried saving this web page using Firefox's "Save Page As > Web Page, complete" but it did not save the comments section (see the saved files). I assume this is because the comments are generated dynamically via JS.

Is there an browser extension, or something else already implemented (e.g., a web service), that could do something like pull the entire DOM out in its current state and save it?

Printing the page as PDF does save the content seen on the browser but the layout is all messed up, plus I really want to save the page's source and media (HTML, JS, CSS, gif, pngs,etc).

Best Answer

The comments actually are really saved (open your HTML file inside archive in a text editor). They are just not getting displayed, because JavaScript on that page hides them on page load.

To see them, you can kill JavaScript temporarily before loading page, for instance using WebDeveloper add-on. After installing it, you will have a new toolbar added, and then choose first tab "Disable" -> "Disable JavaScript".

However when you load original page without JavaScript, the comments are not displayed. So this would mean that Firefox handles that kind of situations gracely. I never thought about it before because I rarely save pages to disk.