Open Bug 1817262 Opened 2 years ago Updated 1 year ago

Clean up homepage code to produce array of nsIURIs instead of the current goop, and use that to load those pages (instead of always doing fixup)

Categories

(Firefox :: General, task, P3)

Desktop
All
task

Tracking

()

Tracking Status
firefox112 --- affected

People

(Reporter: Gijs, Unassigned)

References

Details

The user's homepage doesn't change very often, and we should just be able to have a cached list of nsIURIs, and always use loadURI when loading them.

Instead, we have a Homepage.jsm thing that still tried to deal with localized homepages using .properties files ( bug 1490339), and we have more .split("|") than you can shake a stick at that are used to manually deal with the fact that the pref has historically been |-split. This despite the fact that the URL spec says that | should not be encoded in paths or querystrings, so this isn't actually a safe character to use to separate multiple URLs.

All of this is silly and we should fix it.

This affects callsites in:

https://searchfox.org/mozilla-central/rev/b579290e6b830d1b3f0a941203b0c0e1e56c42a3/browser/base/content/browser.js#3364

https://searchfox.org/mozilla-central/rev/b579290e6b830d1b3f0a941203b0c0e1e56c42a3/toolkit/actors/AboutHttpsOnlyErrorParent.sys.mjs#25

https://searchfox.org/mozilla-central/rev/b579290e6b830d1b3f0a941203b0c0e1e56c42a3/toolkit/actors/NetErrorParent.sys.mjs#149

and probably others.

Severity: -- → N/A
Type: defect → task
Priority: -- → P3

While you're at it, we could validate the URLs before caching them and make sure they use sensible schemes (see bug 1780484)

The Bugbug bot thinks this bug should belong to the 'Core::JavaScript Engine' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → JavaScript Engine
Product: Firefox → Core
Component: JavaScript Engine → General
Product: Core → Firefox
You need to log in before you can comment on or make changes to this bug.