1

How do I customize the file not found page in Firefox 114? I have tried the methods I can find by searching, but can't get any of them to work.

I'm trying to customize or ideally replace the error page for file:// files. I doesn't have to be just for file:// protocol. this is for an offline personal project that is not using a server.

I have tried:

  • Setting browser.xul.error_pages.enabled to true
  • Setting browser.xul.error_pages.404 to a path containing my 404.html:
<html> <head> </head> <body> <p>This is my error page</p> </body> </html>
  • Adding a certerror.xhtml page to C:\Program Files\Mozilla Firefox\browser\content\browser\. I didn't think this would work, but it was worth a try.
  • Editing the user.js file to include:
user_pref("browser.xul.error_pages.enabled", true);
user_pref("browser.xul.error_pages.404", "file:///C:/Users/Greg/AppData/Roaming/Mozilla/Firefox/Profiles/o1e6yv2w.default-release/errorpages/404.html");

Still no luck.

Destroy666
  • 12,350
Greg
  • 13

1 Answers1

0

I don't know where you got browser.xul.error_pages.404 from, but this question is the only reference to it on the internet. certerror.xhtml doesn't sound like anything related to 404 page either.

To find the actual file to edit, you can:

  • go to %ProgramFiles%\Mozilla Firefox (usually C:\Program Files\Mozilla Firefox)
  • open omni.ja archive with e.g. 7-zip
  • go to chrome\toolkit\content\global and open aboutNetError.xhtml

If you check the HTML source, it'll match the source of the 404 page for missing file.

The problem is that the archive is signed and the contents are verified for each version, so you won't be able to edit it. I also don't think there's another way to edit the file, that wouldn't be great in terms of security, if a virus could let's say inject some crypto miner to all your 404 pages.

You can, however, change the CSS at the very least. Check this answer to learn about the basics of editing userChrome.css. E.g. .neterror .title-text would let you edit the error title.

Destroy666
  • 12,350