Closed Bug 2048379 Opened 1 month ago Closed 1 day ago

Generic home settings are initialised in the newtab component, rather than in preferences

Categories

(Firefox :: Settings UI, defect, P3)

defect

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox-esr140 --- unaffected
firefox152 --- wontfix
firefox153 --- wontfix
firefox154 --- fix-optional
firefox155 --- fixed

People

(Reporter: henry-x, Assigned: nina-py, NeedInfo)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

(Taken from bug 2019213 comment 8)

Bug 2019213 moved the configuration of "homepage" and "customHomepage" into the newtab extension.

For Tor Browser, this has caused a problem because, for various reasons, we exclude all the built-in extensions, including browser/extensions/newtab. As such, under the settings redesign the homepage settings fail to load. But we still need to expose the settings to allow the user to change their new tab and home preferences from "about:blank" to "about:tor" (our home page) or a custom web page.

Desired solution

NOTE: I would personally be willing to write the patch since it would benefit us downstream.

Ideally, for downstream projects like Tor Browser, it would be useful if the "homepage" and "customHomepage" settings groups were set up in browser/components/preferences/config/home-startup.mjs instead. Whilst only the "home" setting group is initialised in browser/extensions/newtab/lib/AboutPreferences.sys.mjs. This would keep the parts specific to Firefox Home in the "newtab" extension, whilst keeping the generic parts (home page and new tab preferences) in the preferences directory.

If this was done, a downstream project would only need to make small changes (renaming the "home" option to something other than "Firefox Home (default)"), whilst being able to share the non-trivial extension-set homepage logic.

Current work-around

I'm testing out a work-around that only includes browser/extensions/newtab/lib/AboutPreferences.sys.mjs as an exception and add the method:

  registerGroups(window) {
    // We do not register the "home" component, since this is specific for
    // Firefox Home. tor-browser#44830.
    window.SettingGroupManager.registerGroups({
      homepage: this._setupHomepageGroup(window),
      customHomepage: this._setupCustomHomepageGroup(window),
    });
  }

and then in browser/components/preferences/config/home-startup.mjs I call:

  new AboutPreferences().registerGroups(window);

However, there are a few drawbacks to this:

  1. AboutPreferences.sys.mjs non-lazily imports a number of modules from newtab that need to be removed. Even though these are not used for "homepage" and "customHomepage".
  2. As a downstream project, we are likely to get conflicts in this file.
  3. As a downstream project, this could easily break in the future since we are using the AboutPreferences class in a way not intended by Firefox developers.

Set release status flags based on info from the regressing bug 2019213

:nina-py, since you are the author of the regressor, bug 2019213, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(npypchenko)

Hi Henry, let me discuss this internally and get back to you asap!

Assignee: nobody → npypchenko
Status: NEW → ASSIGNED
Flags: needinfo?(npypchenko)

Hi again Henry, we're going to make this change. I'll submit a patch shortly and I expect it will be in Nightly sometime next week.

Attachment #9599113 - Attachment description: WIP: Bug 2048379 - Move homepage and customHomepage setting groups to the preferences component → Bug 2048379 - Move homepage and customHomepage setting groups to the preferences component r=#home-newtab-reviewers!

Hi again Henry, we're going to make this change.

Hey, thank you so much!

Severity: -- → S3
Priority: -- → P3

There is an r+ patch which didn't land and no activity in this bug for 1 week.
:nina-py, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit BugBot documentation.

Flags: needinfo?(npypchenko)
Flags: needinfo?(mconley)

Can we prioritize landing this and potentially backport to esr 153?

I've updated the patch with a somewhat different approach to fix this issue and requested a re-review on it.

Flags: needinfo?(npypchenko)
Pushed by mconley@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/1b22ae820873 https://hg.mozilla.org/integration/autoland/rev/17f8b43458ab Move homepage and customHomepage setting groups to the preferences component r=fluent-reviewers,reemhamz,mconley,bolsson,flod https://github.com/mozilla-firefox/firefox/commit/b5cb346e8bd5 https://hg.mozilla.org/integration/autoland/rev/3c413dd3e342 Re-inject preferences strings into New Tab's build-time generated train-hop locales. r=mconley
Status: ASSIGNED → RESOLVED
Closed: 1 day ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch

The patch landed in nightly and beta is affected.
:nina-py, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(npypchenko)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: