Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can Firefox's "view source" be set to not make a new GET request?

This is sort of tangential to coding, but programmers often do "view source" on their own pages and on others' pages. I learned that when you do the normal View Source in Firefox, it takes the URL you're at and issues another GET request to that URL. There are two reasons why this is bad:

  1. If you've just issued a POST and do View Source, you won't see the HTML that your browser is actually rendering for you.
  2. If the site author has incorrectly made a form that takes some action (sends email or writes to a DB or whatever), then that action will be taken (or attempted, anyway) again. That's sort of dangerous.

I'd heard there was something I could add to about:config that would prevent this, but had no luck. I also read about some extensions that would get around this, Firebug chief among them, but ctrl-shift-u is so convenient when compared to F12 and then a couple of clicks to find the element you're interested in.

So... Is there a switch I can flip to make Firefox's View Source act like View Generated Source all the time and hit the cache instead of making a new GET request?

like image 413
Ben Hamill Avatar asked Mar 04 '09 17:03

Ben Hamill


2 Answers

If you install the web developer toolbar extension, there's an option under "View Source" called "View Generated Source" which will show you the current source of the page, including any DOM changes you may have made.

like image 135
TJ L Avatar answered Oct 18 '22 03:10

TJ L


You do a Ctrl+A, right click and "view selection source", that doesn't re-request the page.

like image 45
Paul Dixon Avatar answered Oct 18 '22 02:10

Paul Dixon