Tags:


Firefox - View Page Source
March 16, 2009 2:16 AM   RSS feed for this thread Subscribe

How can I make firefox 3 show the actual page source...

Recently firefox has stopped showing the actual page source of the page I'm viewing when doing 'View Page Source', instead it requests the page again - which means that often the source code is not the same as the code I'm looking at.

For example, a page has a form on it, you fill it in and submit the form, if the form posts to the same page, if you do 'View Page Source' the source code I'm seeing is the form, not the resulting output. Another example is where the page changes from one page load to another, you get the new page not the one you're looking at.

Since I installed Firefox 3 it started warning that it had to repost to view the source but its not doing that any more. The reposting thing is annoying and I'd prefer it not to do it but better to do that than give the wrong source code.

If theres no way to make firefox do it properly natively, is there an add-on that will do it? I have the web developer toolbar and can highlight all the page text and 'view selected source' but that doesn't give me the actual rendered source code, it fiddles with it.
posted by missmagenta to computers & internet (22 comments total) 3 users marked this as a favorite
Are you having trouble with dynamically generated AJAX-ey pages?

Try view generated source instead.
posted by fnerg at 2:24 AM on March 16


Nope, no ajax - where would I find 'View Generated Source'?
posted by missmagenta at 2:29 AM on March 16


Using the Miscellaneous > Edit HTML menu on the Web Developer Toolbar, I can see the source for my comment in Live Preview. Does that do the trick?
posted by niles at 2:29 AM on March 16


Close, but its not the actual source

eg. the actual source says color:#dbdccc; and it comes out color: rgb(219, 220, 204)

This: <a href "http://example.com/index.html">Test</a> (where the mistake is fairly obvious) comes out as <a href="" http:="" example.com="" index.html="">Test</a>

I guess it will have to do for now, but it would be great to be able to get the actual source code.
posted by missmagenta at 2:43 AM on March 16


Install Firebug.
posted by cCranium at 3:50 AM on March 16


Install Firebug.

I already have firebug
posted by missmagenta at 4:00 AM on March 16


web developer toolbar > view source > view generated source
posted by fnerg at 4:28 AM on March 16


What don't you like about Firebug? It should have no problem displaying the current source in full. In fact, if you click the bug icon and click 'Open with editor' you can access the full HTML in your editor of choice.
posted by cdmwebs at 5:40 AM on March 16


I'm pretty sure "View Generated Source" is what you want, as mentioned above. Could you give that a try and let us know where it's falling short? The rgb() values, for example, sound like they're coming from some other part of Firebug or Web Developer Toolbar.
posted by odinsdream at 5:54 AM on March 16


What don't you like about Firebug?
I never said I didn't like Firebug, if I didn't like it I wouldn't have it installed. The person who suggested it didn't specify how installing firebug would solve the problem.

It should have no problem displaying the current source in full.
It does, inspecting the source in Firebug still shows the modified source not the actual source

In fact, if you click the bug icon and click 'Open with editor' you can access the full HTML in your editor of choice.
That does the trick - weird that opening it in the editor gives the real source code but inspecting or editing it in firebug gives the modified source. Its a bit of a pain to have to open up another program just to view the real source code but it works.
posted by missmagenta at 6:03 AM on March 16


I'm pretty sure "View Generated Source" is what you want, as mentioned above. Could you give that a try and let us know where it's falling short? The rgb() values, for example, sound like they're coming from some other part of Firebug or Web Developer Toolbar.

I already did... see here. Those aren't coming from Firebug, it still does it with firebug disabled. If its coming from Web Developer Toolbar then it still wont help since disabling that would also disable 'View Generated Source', theres nothing I can find in the options that would disable messing around with the source code.
posted by missmagenta at 6:12 AM on March 16


I have the same problem and it's annoying that Firefox feels the need to reload the source.

You can prepend the URL (in the address bar) with

view-source:

which I believe will show the source without reloading the page.
posted by null terminated at 7:32 AM on March 16


I never said I didn't like Firebug

Sorry. For some reason when I read that it sounded snarky or something. ;)

It does, inspecting the source in Firebug still shows the modified source not the actual source

Really? That's weird. Is the site you're looking at publicly available? I'm not sure I've ever noticed that before.
posted by cdmwebs at 7:53 AM on March 16


I made a test here

For me, if I view source (isn't a problem on this page since reloading the page will give the same code every time) I get : <a href "http://example.com/index.html">Test</a>

If I do Firebug (clicking on the bug) -> edit, I get <a href="" http:="" example.com="" index.html="">Test</a>

If you do open in editor, all fine. FWIW, the open in editor thing is actually quite handy for what I was doing (though annoying for day-to-day stuff), its an html email template that I got tired of modifying myself and wrote a php script to take info from a form and chuck out the generated html (which is why it has colours and stuff in the code). Then I usually view source and copy and paste it into my editor anyway.
posted by missmagenta at 8:11 AM on March 16


You can run php scripts from the command line, and it'll just output the html to standard out. It sounds like that will work well for you too, plus you won't have to deal with any browser issues.
posted by philomathoholic at 8:35 AM on March 16


Sorry missmagenta, I meant to suggest using Firebug's Inspect tool which has always shown the real html for me, but on your test page it exhibits the same behaviour with the malformed html.

null terminated's view-source: recommendation looks to be best.
posted by cCranium at 10:03 AM on March 16


Have you tried disabling Firebug to see whether this is a problem with Firefox or the extension? If I view source in Firefox, I get the page source. I don't see what you are seeing, and I'm not getting any complaints about needing to repost to see source.
posted by caution live frogs at 10:06 AM on March 16


You're missing an equals sign between href and the value. That's why Firebug is borked.

<a href="http://example.com/index.html">Test</a>

That appears correctly for me.
posted by cdmwebs at 11:14 AM on March 16



You're missing an equals sign between href and the value. That's why Firebug is borked.


The mistake is intentional, to show that firebug is not showing the html as written - its modifying it. It makes other modifications too but that was the easiest to demonstrate.
posted by missmagenta at 2:31 PM on March 16


eg. the actual source says color:#dbdccc; and it comes out color: rgb(219, 220, 204)

I think part of the issue you're seeing is that Firefox View Page Source does not show you the HTML it received from the web server, it shows you Firefox's interpretation of it. If you want to see the actual HTML from the web server, use IE. I know, this doesn't answer your question, but apparently that's the way Firefox is built.
posted by exphysicist345 at 7:42 PM on March 16


Well, that makes sense. Firebug is trying to parse that invalid HTML. Yeah, I'd just curl or wget it if you want invalid HTML and all. Nothing will change that way.
posted by cdmwebs at 9:19 PM on March 16


I don't think it's just FFX3, either. I remember being annoyed by this behavior the first time I tried View Source with Firefox, which would have been before 1.0 came out.
posted by flabdablet's sock puppet at 3:23 PM on March 17


« Older My friends and I are going on ...   |   I have 50 dollars in a checkin... Newer »

You are not logged in, either login or create an account to post comments