Open Bug 1722896 Opened 3 years ago Updated 11 months ago

Take aboutNetError.js into the 21st century

Categories

(Firefox :: Security, task)

Desktop
All
task

Tracking

()

Tracking Status
firefox92 --- affected

People

(Reporter: Gijs, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

There are a lot of unfortunate things happening in this file

In no particular order, and not limited to:

  1. we wait for DOMContentLoaded to set the page up. There's no particular reason we need to do this. The script is loaded as a module at the end of the page, so any elements we need are guaranteed to be present.
  2. The parameters we need are repeatedly extracted from the query string - we could just do that once.
  3. The file is 1000+ lines of toplevel functions, with the main initPage one somewhere in the middle; they should be organized better
  4. The logic for classes, descriptions, etc. is completely higgledy-piggledy, so it's very hard to determine what errors get treated in what way.
  5. It uses CSSOM where it should be using classes that get used by CSS, or the hidden property where applicable.
  6. We use innerHTML for DTD-based strings, that should be converted to fluent. We should have a central mapping of error codes to error message identifiers, and stick to it. This will likely mean we also need to update the docshell versions of this page & script.
  7. Passing arbitrary localized text content from the docshell side to the main page is 😬
See Also: → 1725965
Depends on: 1734217
Depends on: 1790187
See Also: → 1794423
Blocks: necko-error
You need to log in before you can comment on or make changes to this bug.