Sterling Archer
Sterling Archer

Reputation: 22435

Resend HTTP source (reload page source code)

Is there a way to (without inspecting elements via chrome dev tools) resend the http request that displays a pages's source code?

I load some dynamic HTML, and it looks fine in my inspector, but I'd like to see it in the source code view. Is there a way to tell my browser to resend the source but with the dynamic html included?

Upvotes: 0

Views: 514

Answers (2)

Mooseman
Mooseman

Reputation: 18891

Nope.

The devtools browse the dom, not the source. If you manipulated the dom with js, it will no longer match the source.


Requested workaround:

  1. Open devtools
  2. Right-click the <html> element and select 'Edit as HTML.'
  3. Hit Ctrl+A followed by Ctrl+C
  4. Open your editor of choice and paste code

This will be a snapshot of the dom.

Upvotes: 1

Radley Sustaire
Radley Sustaire

Reputation: 3399

You can view the source code of ajax/xhr requests (if that's what you're looking for). Try Chrome using the dev tools. Go to the Network tab, turn on the recording button, then make your ajax call. It should pop up on the left. You can then use the "Response" tab to see the actual source code that was sent to you.

You can also right-click a network request and do "Replay XHR" to re-send your ajax request. Your script probably won't process it, though.

I'm not sure if this is exactly what you are looking for, if it isn't, can you clarify? "Dynamic HTML" is a bit ambiguous.

(FYI The DOM is source code that has been modified by the browser. The original source code is under right click > view page source.)

Upvotes: 0

Related Questions