Page MenuHomePhabricator

Bug 2048048 - Fix policy issues with new tab preferences. r?jmendez
ClosedPublic

Authored by mkaply on Jun 17 2026, 4:52 PM.
Referenced Files
Unknown Object (File)
Tue, Nov 10, 2:45 AM
Unknown Object (File)
Sun, Nov 1, 9:48 AM
Unknown Object (File)
Fri, Oct 30, 6:45 AM
Unknown Object (File)
Thu, Oct 29, 5:29 PM
Unknown Object (File)
Thu, Oct 29, 4:50 PM
Unknown Object (File)
Thu, Oct 29, 3:21 PM
Unknown Object (File)
Thu, Oct 29, 2:40 PM
Unknown Object (File)
Thu, Oct 29, 2:39 PM

Diff Detail

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.

This revision makes changes to files both inside browser/extensions/newtab and in files outside of it. The New Tab page for Firefox Desktop supports train-hopping — a mechanism that allows New Tab code to be deployed to Beta and Release channels independently of the standard release train. Cross-layer changes can break train-hop compatibility, which may block New Tab deployments until fixes reach Release through normal channels.

If your change modifies platform code that browser/extensions/newtab depends on (such as module URIs, DOM APIs, or Nimbus feature definitions), please check whether a compatibility shim is needed. Shims should be marked with a @backward-compat { version NNN } comment indicating the Firefox version that must reach Release before the shim can be removed.

If your change is unrelated to the New Tab page's train-hop compatibility (for example, it only touches tests or documentation), you can possibly disregard this message - but if you are unsure whether your change affects train-hop compatibility, please ensure that someone from the home-newtab-reviewers-rotation review group has a chance to review before landing.

nina-py requested changes to this revision.Jun 18 2026, 3:35 AM
nina-py added a subscriber: nina-py.

@mkaply, could you please add manual test steps for this in the context of enterprise policies and outline what the expected behaviour is for supportFirefox, Stories, and Weather after the changes?

browser/components/enterprisepolicies/Policies.sys.mjs
1783–1787

question:
With this change, Stories: false, Locked: true no longer locks feeds.system.topstories (same for Pocket above). New Tab code in AdsFeed, NewTabAttributionFeed, DiscoveryStreamFeed, and Base.jsx still read that pref directly and will behave as if Stories were available. Was that intentional?

browser/components/enterprisepolicies/tests/browser/browser_policy_firefoxhome.js
198–202

suggestion: I would drop this as this setting has been on by default since 152. Alternatively, I'd make sure the pref is true, otherwise it's possible to run this test in an environment with SRD off and test nothing because of an early return.

SpecialPowers.pushPrefEnv({ set: [["browser.settings-redesign.enabled", true]] })
browser/extensions/newtab/lib/AboutPreferences.sys.mjs
1432–1437 ↗(On Diff #1302638)

question:
What's the intent for the case where one child is locked on and the other locked off? The OR makes the toggle read on (still disabled), but the comment only mentions the case where both are off.

Also, what's the intention behind this change? The bug mentions "I added some custom code that does the right thing based on the checkboxes" but it would help to have the intended behaviour spelled out.

This revision now requires changes to proceed.Jun 18 2026, 3:35 AM
mkaply added inline comments.
browser/components/enterprisepolicies/Policies.sys.mjs
1783–1787

Yes. In the new design, setting those preferences to false makes Stories disappear completely (that's not what happened before). All we were trying to do is turn them off.

browser/extensions/newtab/lib/AboutPreferences.sys.mjs
1432–1437 ↗(On Diff #1302638)

What's the intent for the case where one child is locked on and the other locked off?

It should be disabled on (which I think would match the UI in the the non disabled case as well)

The intention behind this change is that currently if you lock the two preferences, the checkboxes are disabled, but you can still use the "Support Firefox" toggle to visually turn the checkboxes on and off even though it doesn't actually do anything.

If the checkboxes are disabled by policy, the Support Firefox should be disabled as well.

jmendez requested changes to this revision.Jun 18 2026, 4:01 PM
jmendez added inline comments.
browser/extensions/newtab/lib/AboutPreferences.sys.mjs
1432–1437 ↗(On Diff #1302638)

I have a wariness from historically running into trouble disconnecting a UI's displayed value from its internal value, as the get implementation appears to do here (although I don't have a practical known issue to raise here). I wonder if this might not be better solved in Policies.sys.mjs by setting and locking "browser.newtabpage.activity-stream.showSponsoredCheckboxes" to the appropriate value if both policies are locked.

mkaply added inline comments.
browser/extensions/newtab/lib/AboutPreferences.sys.mjs
1432–1437 ↗(On Diff #1302638)

That's an interesting idea. I think I like that. Gets me out of the new tab business completely.

mkaply updated this revision to Diff 1307011.
mkaply retitled this revision from Bug 2048048 - Fix policy issues with new tab preferences. r?jmendez,#home-newtab-reviewers-rotation to Bug 2048048 - Fix policy issues with new tab preferences. r?jmendez.

No longer affects new tab code, so removing reviewers.

Everything address. Much smaller patch now.

Thanks, this works more cleanly!

This revision is now accepted and ready to land.Jun 23 2026, 9:11 PM

This revision requires a Testing Policy Project Tag to be set before landing. Please apply one of testing-approved, testing-exception-unchanged, testing-exception-ui, testing-exception-elsewhere, testing-exception-other. Tip: this Firefox add-on makes it easy!

This revision is now accepted and ready to land.Jun 25 2026, 12:51 AM
This revision is now accepted and ready to land.Jun 25 2026, 3:02 AM