4

I have a webapp that I want to save the HTML of to create a static version of a page I can send to someone. Obviously 'save as' won't work.

Is there a way to save the currently displayed DOM as HTML, even when it has been created by javascript?

Update with more information

Apparently it's not clear what I'm asking. I have an ember app. The index.html page contains:

<!DOCTYPE html>
<html lang="en">
  <body>
    <script>
      window.AppENV = {{ENV}};
      window.EmberENV = window.AppENV.EmberENV;
    </script>
    <script src="assets/vendor.js"></script>
    <script src="assets/app.js"></script>
    <script>
      window.App = require('app/app')['default'].create(AppENV.APP);
    </script>
  </body>
</html>

I also have a template like:

<ul>
{{#each thing in things}}
   <li>{{thing.title}}</li>
{{/each}}
</ul>

When I load this app in my browser, the underlying HTML will in the DOM will be something like this, and this is what I want to save directly:

<!DOCTYPE html>
<html lang="en">
  <body>
    <ul>
      <li>my thing 1</li>
      <li>my thing 2</li>
    </ul>
  </body>
</html>

So how can I save the HTML generated by my app as a static page like this? Using the browser's 'Save as' only saves the raw index.html. It doesn't traverse the DOM and dump the generated HTML which is what I want (at least it doesn't in chrome).

1 Answers1

-1

Chrome and Firefox will save a copy of the page as it's currently displayed (ie using the current DOM) with Ctrl+S / Save Page As... if you choose Web page, complete.

For info, if Web page, HTML only is selected, you get the initial HTML instead.

Try on this page for example.

lemonsqueeze
  • 1,330