I have a webpage that's open in a chrome browser but the page no longer exists. What javascript should I type in the console to get a copy of the entire page html?
I have a webpage that's open in a chrome browser but the page no longer exists. What javascript should I type in the console to get a copy of the entire page html?
To get a copy of the entire HTML of the currently loaded page in Chrome's console (even if the page is no longer available but still present in the DOM), follow these steps: 1. **Open the Chrome DevTools Console**: Press `F12` or `Ctrl+Shift+J` (Windows/Linux) / `Cmd+Option+J` (Mac). 2. **Run this JavaScript command**:
1 2 | copy(document.documentElement.outerHTML); |
1 2 | console.log(document.documentElement.outerHTML); |
Testing if the previous output contains the string outerHTML
: True