Този сайт ще има ограничена функционалност, докато се извършва тече неговата поддръжка. Ако дадена статия не може реши проблема ви и искате да зададете въпрос, нашата общност е готова да ви помогне на @firefox в Twitter и /r/firefox в Reddit.

Търсене в помощните статии

Избягвайте измамите при поддръжката. Никога няма да ви помолим да се обадите или изпратите SMS на телефонен номер или да споделите лична информация. Моля, докладвайте подозрителна активност на "Докладване за злоупотреба".

Научете повече

How do I customize the error pages in Firefox 24?

  • 6 отговора
  • 8 имат този проблем
  • 1 изглед
  • Последен отговор от ekan

more options

I'd like to customize the HTLM/CSS/JavaScript of all the Firefox 24 error pages, i.e. the network connectivity lost, DNS and other standard error pages.

I'd like to customize the HTLM/CSS/JavaScript of all the Firefox 24 error pages, i.e. the network connectivity lost, DNS and other standard error pages.

Избрано решение

There are two omni.ja files in Firefox 24 on Ubuntu 12.04: /usr/lib/firefox/omni.ja /usr/lib/firefox/browser/omni.ja

Unzip the first file into it's own directory. Then you can edit: omni.ja/chrome/toolkit/content/global/netError.xhtml

Прочетете този отговор в контекста 👍 3

Всички отговори (6)

more options

Hello ekan,

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

  1. 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.

more options

I don't think that this is possible. You probably would have to create an extension to replace the current files.

  • view-source:chrome://global/content/netError.xhtml
  • view-source:chrome://global/skin/netError.css
  • view-source:chrome://global/locale/netError.dtd
more options

classic.jar doesn't exist in Ubuntu 12.04 Linux, as far as I can find. /usr/lib/firefox/browser/omni.ja does exist, but there's no netError.css in it anywhere...

more options

It used to be possible in previous Firefox versions by editing the netError.xhtml file, which was located in the compressed omni.ja in chrome/toolkit/content/global

more options

Избрано решение

There are two omni.ja files in Firefox 24 on Ubuntu 12.04: /usr/lib/firefox/omni.ja /usr/lib/firefox/browser/omni.ja

Unzip the first file into it's own directory. Then you can edit: omni.ja/chrome/toolkit/content/global/netError.xhtml

more options

Note that you know have to re-zip omni.ja using this command (thanks mozian!): zip -qr9XD omni.ja *