How To View Page Source without Reposting in Firefox
So,
- you are viewing a web page using the Firefox web browser (mine is version 3.0.15), and
- you want to view the original source code of that page (e.g the, client-side*, HTML document)
The way to do this differs depending on the method that was used to request the page
Whilst viewing the page (that you want to view the source of) - do the following:
- If you arrived at the page using a GET method:
(i.e. you came to the page by typing a web address into the address bar or by clicking on a simple web link)- Do the following:
- From the Firefox Menu Bar,
Click:View > Page Source - Using the Keyboard
Type:CTRL+U
OR
- From the Firefox Menu Bar,
- The source code should open in a new window
- Do the following:
- If you arrived at the page using a POST method:
(i.e. can happen after you filled in a web form) :- You need to have set up Firefox in a special way before the page loaded - see requirements below.
- From the Firefox Menu Bar,
Click :Tools > Firebug > Open With Editor > [click the editor name] - The source code should open in a new window
Requirements to view source of a POSTed page in Firefox without having to do a reload
You need:
- Firefox Web Browser
Note: I am using Firefox version 3.0.15 - so this how-to guide may, or may not, be applicable depending the version you are using. Try it and see. - The “Firebug” Add on for Firefox must be installed and enabled.
I am using Firebug version 1.4.3
See more about add-ons at: https://addons.mozilla.org - Some Text Editor on your machine
e.g Windows Notepad or Programmer’s file Editor
Not got ‘em?
- If you do not have Firebug, or
- If you do not have a text editor setup in Firebug
read on…
How to Set it Up
- Optionally - Bookmark or print this webpage ‘cos your browser may have to restart at some stage during these steps.

- Install and enable the Firebug add-on:
In Firefox Browser, Click: Tools > Add-ons > Get Add-ons > Browse All Add-ons > go searching for “Firebug” and follow instructions from there - Open up Firefox, if not already open, so that we can set up the text editor in Firebug
- Tell Firebug Which Editor to Use:
In Firefox Browser, Click: Tools > Add-ons > Open With Editor > Configure Editors… - In the Configure Editors dialogue box, click: ‘Add’
- In the Editor Configuration dialogue box,
Fill in as follows, then click OK:- Name
- [just a nice name of your choosing to describe the text editor that you want to use ]
e.g “My Windows Notepad” - Executable
- [Click ‘Browse…’ to locate the path to your text editor on your computer]
e.g. On my Windows XP PC, I browsed to “My Computer > Local Disk (C:) > WINDOWS > NOTEPAD.EXE” to add the path to notepad.exe - Arguments
- [I just left this blank]
- Graphic Example
-

- That’s it. You should now have Firefox set up to be able to view source code without having to do a reload of the web page.
Background to this Blog Post
One annoying “feature” of Firefox is that it seems that you cannot view the source code of a page (that has been returned after a POST request) without having to repost the request. If you try the usual technique (outlined for the GET method, above) - it won’t work. Instead you get an error message or dialogue box asking you if you want to re-send the request. It offers options to “Resend or Cancel”:
“To display this page, the application must send information that will repeat any action (such as search or order confirmation) that was performed earlier”

Generally, a POST is used for actions that you do not want to perform twice - so it is very annoying when you want to dig up an error in the source code on these kinds of pages. A re-post does not always return the same source code.
The, slightly convoluted, technique (outlined for the POST method, above) worked for me.
If you know of an easier way, then please add a comment below.
* Foot Note: The tutorial above talks about client-side source code, only. You cannot view the server-side source code of a web page unless something has gone horribly wrong on the website’s server. This is because server-side source code does all its pre-processing behind the scenes and then outputs the web resource (html, xml, image, css etc) for the browser.

November 7th, 2009 at 1:31 am
Why are you using an old version of FireFox? I’m on 3.5.4 here. If I want to view the source I right click anywhere on the page and select ‘view page source’ and it pops up in its own little window. Don’t you have that option?
November 7th, 2009 at 8:17 am
not sure - i thought my versions upgraded themselves. It might be held back from newer versions cos of the add-ons i have installed.
Yeah i do use the right-click view source thing for GETed pages. But if i want to view source of a POSTed page Firefox wants to do a reload. If the page varies between iterations of the POST REQUESTs it can be more difficult to see the real original source.
June 1st, 2011 at 5:51 pm
[…] One day,My colleague asked me a question that some data interface url when viewing the source code and the interface shows the different.I guess that when the source code in the display to re-request the data。Through google I find the some answer,look at this and this. […]
June 30th, 2011 at 11:48 am
I’m disappointed because even Internet Explorer does it without resending the request.
Suppose I did a credit card payment and then request the page source with Firefox, then I am paying twice. Firefox does not warn me against this.
June 30th, 2011 at 1:13 pm
Oops. Mistake. Firefox does warn me.
But still a clumsy way to need to install firebug first.