MozillaZine

How can I customize firefox error page

Discussion of general topics about Mozilla Firefox
slasher
 
Posts: 2
Joined: November 23rd, 2006, 8:39 pm

Post Posted November 23rd, 2006, 8:42 pm

I want to customize the "server not found" page. I remember seeing something about it, but I can't find how to do it anywhere.

Any help is appreciated.

smsmith
Moderator

User avatar
 
Posts: 18871
Joined: December 7th, 2004, 8:51 pm
Location: Illinois

Post Posted November 23rd, 2006, 10:59 pm

Hmm. This can be done, but you're going to need to get pretty dirty to get it done. Ready?

First, learn about userContent.css:
http://kb.mozillazine.org/UserContent.css
http://kb.mozillazine.org/Profile_folder

Now, the easiest way to learn about the elements on the error page is to go to the source. So, go to the chrome folder in the Firefox program folder, usually C:\Program Files\Mozilla Firefox\chrome in Windows Explorer. Find the file called classic.jar and copy that somewhere else. Rename classic.jar to a .zip file and extract it, preferably to a folder called classic at whatever location you are at. Then, open the classic folder and navigate to ...\classic\skin\classic\global and find the file called netError.css.

Open the netError.css file in Wordpad (Notepad doesn't seem to work for me because then the lines all run together). See all the code that starts with the # symbol? Those are the things you can easily change. Copy all the #ELEMENT code into your userContent.css file.

Now you can start making changes to see what you like. I would make small changes at a time to see if it works the way you want. After each change, you need to close and restart Fx. Here's one to get you going:
Code: Select all
#errorPageContainer {
  -moz-border-radius: 0px !important;
  background-color: red !important;
}

That should make the box that surrounds the error message be red with square corners instead of white with a rounded corner border. Remember that before every semi-colon, you need to put !important or the change won't do anything.

Good luck. :D

-Sean
:P
Give a man a fish, and he eats for a day. Teach a man to fish, and he eats for a lifetime.
I like poetry, long walks on the beach and poking dead things with a stick.
Please do not PM me for personal support. Keep posts here in the Forums instead and we all learn.

Thumper

User avatar
 
Posts: 8037
Joined: November 4th, 2002, 5:42 pm
Location: Linlithgow, Scotland

Post Posted November 24th, 2006, 2:35 am

This is all much easier if you use the Stylish extension in conjunction with the DOM inspector. No messing around in jar files or profile directories.

- Chris

Frank Lion

User avatar
 
Posts: 17613
Joined: April 23rd, 2004, 6:59 pm
Location: ... The Exorcist... United Kingdom

Post Posted November 24th, 2006, 4:25 am

Thumper wrote:This is all much easier if you use the Stylish extension in conjunction with the DOM inspector. No messing around in jar files or profile directories.

Errr, once you have learnt how to use both - yeah, people are going to really learn the DOMi just for this.

Please stop glowering with resentment in the background when other people are making an effort to learn things.

- Frank
Metal Lion latest Firefox Themes -Tiger SP, Tiger, Graphite, Australis
"The only thing necessary for the triumph of evil, is for good men to do nothing." - Edmund Burke (attrib.)

Zoolcar9

User avatar
 
Posts: 2225
Joined: November 9th, 2004, 6:45 pm
Location: Jakarta, Indonesia (UTC+7)

Post Posted November 24th, 2006, 8:47 am

My Firefox information | Add-ons | GitHub

"With great power, comes great desire to show it off."

smsmith
Moderator

User avatar
 
Posts: 18871
Joined: December 7th, 2004, 8:51 pm
Location: Illinois

Post Posted November 24th, 2006, 7:37 pm

Thumper wrote:This is all much easier if you use the Stylish extension in conjunction with the DOM inspector. No messing around in jar files or profile directories.

Yes, I realize there are easier ways to do this. But, I took the chance that he/she doesn't know anything about the structure or the coding required for the page. Trying to teach someone about domI in a forum thread doesn't sound like an easy task. I should know, Frank's already schooled me on quite a bit. Thanks Frank! :)

The reason I gave the location of the jar and the file in it, is that's the easiest way I could think of for them to see how the page is put together.

-Sean
:P

old FatJohn
 
Posts: 0
Joined: December 31st, 1969, 5:00 pm

Post Posted November 24th, 2006, 8:18 pm

FWIW this extension modifies the page. <a href="https://addons.mozilla.org/firefox/3336/">ErrorZilla Mod | Firefox Add-ons | Mozilla Corporation</a>

slasher
 
Posts: 2
Joined: November 23rd, 2006, 8:39 pm

Post Posted November 24th, 2006, 10:38 pm

I've found the neterror.css file. It doesn't have what I'm looking for. Basically I want to change the text of the error message itself. I'm using 7-zip, which lets me browse the .jar files directly. I can't seem to find where the actual error codes themselves are.

fastveg
 
Posts: 2
Joined: September 7th, 2008, 6:35 pm

Post Posted September 7th, 2008, 6:41 pm

So what file are the error messages themselves in? Having the same problem here.

fastveg
 
Posts: 2
Joined: September 7th, 2008, 6:35 pm

Post Posted September 7th, 2008, 6:51 pm

Found them.

C:\Program Files\Mozilla Firefox\chrome\en-US.jar\locale\en-US\global\netError.dtd

Change the jar to a zip to modify, obviously.

;)

Pynchon
 
Posts: 21
Joined: November 3rd, 2009, 6:08 pm

Post Posted November 3rd, 2009, 6:13 pm

Great information... been trying to figure this out for a few days. Question I have is this. I created a host file for our work server which blocks specific sites, if I try to access those sites from any computer I just receive the page can not be displayed message. What I would like to do is create a page that recognizes 127.0.0.1 and display it's own page; is this possible?

Better yet, is there any way to create an internal computer error page (cross browser) without having to install a webserver? Is it possible with ODBC or something?

ttocsmij

User avatar
 
Posts: 33
Joined: February 4th, 2006, 10:16 pm

Post Posted December 1st, 2009, 3:30 pm

Apologies as this is basically off-topic, per se. If I understand the netError.xhtml code properly, one only needs to properly "call it" to obtain the appropriate error page. What I'd like to know is how to format that call. I ran across this "call" in an article last week:

moz-neterror:page?e=404&u='http://www.sample.com/'&d='this is the description to be used'

but entered from the browser it only displays a blank page so I know I am missing a detail or two. :-)

Does anyone know a link or article where I can get the rest of the details? Thanks in advance for your patience and assistance.
"Of all the things I've lost, I miss my mind the most!" - Mark Twain

LoudNoise
Moderator

User avatar
 
Posts: 39132
Joined: October 18th, 2007, 1:45 pm
Location: Next door to the west

Post Posted December 1st, 2009, 3:43 pm

Somewhat OT and you are replying to an elderly thread (started 2006). Locking. Please start a new thread.
Post wrangler
β€œIt's tough to make predictions, especially about the future.”
― Yogi Berra

Return to Firefox General


Who is online

Users browsing this forum: No registered users and 5 guests