I have a web page with some auto-generated javascript content which manipulates the DOM when users click on certain links. When I save the page in Firefox, it just saves the original page without the DOM modifications. How can I save or dump the current state of the HTML DOM as manipulated by the javascript?
DOM Inspector has a File->Save DOM As...
option.
Looks like FireFox have replaced the DOM Inspector with a new tool that no longer has this functionality.
In the new DOM Inspector Ctrl + Shift + I there is a Console that accepts commands.
This sometimes works...
console.log(document.documentElement.innerHTML)
This gives you something you can inspect but not copy paste because of some bug...
alert(document.documentElement.innerHTML)
This works like console.log(document.documentElement.innerHTML) ought to....
document.documentElement.innerText = document.documentElement.innerHTML
<html ...>
and choose Copy > Outer HTML, then paste into a text editor. That should grab everything in the current state of the page except the opening <!DOCTYPE>
which you can copy separately. –
Rotation You could also use firebug to edit the DOM and save the full document markup.
This turns out to be quite difficult; however, I found a Firefox add-on that works great.
Save Page WE by DW-dev
https://addons.mozilla.org/en-US/firefox/addon/save-page-we/
It is also available for Chrome.
https://chrome.google.com/webstore/detail/save-page-we/dhhpefjklgkmgeafimnjhojgjamoafof
In Firefox 107, I just open up Web Developer Tools, choose the (DOM) Inspector window, right click the <html>
tag, hover over Copy, and click on "Outer HTML".
Then I can paste it wherever I want.
No need for an extension or unmemorable code just for one-off usage.
Select-All, Context Menu (right-click or Menu key), View Selection Source
.
In a few keystrokes: Ctrl+A, ≣ Menu, E. Save with Ctrl+S (PC-style keyboard).
© 2022 - 2024 — McMap. All rights reserved.