how to get fully computed HTML (instead of source HTML)?

The Web Developer Toolbar for Firefox has a "View Generated Source" option which provides this functionality.


With Firebug's HTML tab, you can right click on the <html> element, and click "Copy HTML".

You can do the same thing with Developer Tools in Chrome/Safari.


with (window.open("")) {
    document.open("text/html");
    document.write("<!--\n"); //for live version delete this line
    document.write(opener.document.documentElement.outerHTML.replace(/</g,"<").replace(/>/g, ">"));
    document.write("\n//-->"); //for live version delete this line
    document.close();
    document.title = "DOM Snapshot:" + opener.document.title;
    focus();
}
  1. Open console
  2. copy paste the above code and execute
  3. it opens an empty page,
  4. now inspect the page with right click or f12,
  5. copy outerhtml of the comment
  6. paste wherever you want
  7. optionally remove the comment at the start and end

If you want a live version that is clickable, then simple leave out the comment tags in the above code.