Copy HTML to clipboard

A bookmarklet to copy the rendered HTML of a current page to clipboard

Copy HTML
(Drag this button to your boormarks toolbar)

Source code

navigator.clipboard.writeText(document.documentElement.outerHTML);

Notes

The bookmarklet copies the full rendered HTML of the current state of the current page, excluding the DOCTYPE declaration. Could be significantly different from the original HTML received from a web server due to browser processing and JavaScript code modifying the page after loading.

Feedback

Leave a comment here: @ugnich