I would like to be able to save the state of the html page after I've interacted with it.
Say I click a checkbox, or the javascript set the values of various elements.
How can I save the "javascript-rendered" page?
Thanks.
This HTML Response object can then be used in an Optimizer policy to present the webpage. To create an HTML Response object all you need is a name and the html for the webpage. Use the following instructions to create an HTML Response object. Go to Configuration > Objects > HTML Response.
Rendered Code There, right-click on the opening <html> tag of the code, and select Copy > Copy outerHTML. You can then paste this in to a new text file as well.
In Chrome (and apparently Firefox), there is a special copy() method that will copy the rendered content to the clipboard. Then you can do whatever you want by pasting it to your preferred text editor.
https://developers.google.com/chrome-developer-tools/docs/commandline-api#copyobject
Console Example:
copy(document.body.innerHTML);
Note: I noticed Chrome reports undefined after the method is run, however, it seems to execute correctly and the right content is in the clipboard.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With