Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions browser/app/profile/firefox.js
Original file line number Diff line number Diff line change
Expand Up @@ -2874,7 +2874,12 @@ pref("browser.migrate.preferences-entrypoint.enabled", true);
// "offered" - we have offered feature to user and they have not yet made a decision.
// "enabled" - user opted in to the feature.
// "disabled" - user opted out of the feature.
#ifdef MOZ_ENTERPRISE
// Firefox Relay is not supported in enterprise builds

@1rneh 1rneh May 21, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: "not supported" might be misleading here. We support it but the default for enterprise builds is that it's disabled but can be enabled by a policy (which doesn't exist as of now).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we support it (I thought we don't based on the excel), then the tests should be enabled and set "signon.firefoxRelay.feature", "available" for those tests for enterprise. (together with the original unlock of url). Do you see it like this or have a diferent opinion?

@1rneh 1rneh May 22, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comment was intended as a nit and solely about the phrasing of the comment. But I have to correct my previous statement. An idea was to have a policy to disable Relay. But now that I'm revisiting this, that policy won't be applicable for Firefox Enterprise builds.

Let's wait for a product decision, because if we disable the Relay feature entirely, we also need to make sure it's not surfaced and toggleable from anywhere e.g. about:preferences, ideally with test coverage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, is my understand correct now, that we do not support relay?

I wrote a test already using their utils and similar logic, but based on your comment we need to test more (i.e about preferences and so on).

@1rneh 1rneh May 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as of now we do not support Relay, hence the user shouldn't be able to turn it on. I checked and setting the preference signon.firefoxRelay.feature to unavailable instead of disabled, will make it not show up e.g. in about:preferences#privacy. So let's set the preference value to unavailable? Relay then still shows up on about:preferences#moreFromMozilla, but that section can be controled via the policy UserMessaging.

@victhorlopez victhorlopez May 29, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where did you get this unavailable from?

In the prefs it is not stated, and for this check they use this. Does it behave different than disabled?

link

edit: I just tried and with unavailable it disappears ... nice

@victhorlopez victhorlopez May 29, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on this test I guess this is equivalent to undefined?
test

edit: ok I am leaving it as unavailable, reason is to get undefined we should not set the pref, but that seems quite easy that it gets broken

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a vague memory that when we integrated relay into the password manager that we made a distinction between whether the pref was set to unavailable or disabled. So I tried it out and then assumed preemptively that unavailable was the correct value. But I think you are pointing it out correctly. It can be any arbitrary value except "available", "offered", "enabled" or "disabled".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reached out to Relay folks to make sure this doesn't cause unexpected breakage.

pref("signon.firefoxRelay.feature", "unavailable");
#else
pref("signon.firefoxRelay.feature", "available");
#endif
pref("signon.management.page.breach-alerts.enabled", true);
pref("signon.management.page.vulnerable-passwords.enabled", true);
pref("signon.management.page.sort", "name");
Expand Down
8 changes: 8 additions & 0 deletions toolkit/components/passwordmgr/test/browser/browser.toml
Original file line number Diff line number Diff line change
Expand Up @@ -270,17 +270,25 @@ skip-if = [
"os == 'win' && os_version == '11.26200' && verify-standalone",
]

["browser_relay_disabled_enterprise.js"]
support-files = ["browser_relay_utils.js"]
run-if = ["enterprise"]

["browser_relay_signup_flow.js"]
support-files = ["browser_relay_utils.js"]
skip-if = ["enterprise"]

["browser_relay_signup_flow_showToAllBrowsers.js"]
support-files = ["browser_relay_utils.js"]
skip-if = ["enterprise"]

["browser_relay_telemetry.js"]
support-files = ["browser_relay_utils.js"]
skip-if = ["enterprise"]

["browser_relay_use.js"]
support-files = ["browser_relay_utils.js"]
skip-if = ["enterprise"]

["browser_rust_mirror.js"]
skip-if = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
const TEST_URL_PATH = `https://example.org${DIRECTORY_PATH}form_basic_signup.html`;

Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/toolkit/components/passwordmgr/test/browser/browser_relay_utils.js",
this
);

add_task(async function test_enterprise_relay_feature_default_disabled() {
Assert.equal(
Services.prefs
.getDefaultBranch("")
.getStringPref("signon.firefoxRelay.feature"),
"unavailable",
"signon.firefoxRelay.feature default should be 'unavailable' in enterprise builds"
);
});

add_task(async function test_enterprise_relay_utils_reports_disabled() {
const { FirefoxRelayUtils } = ChromeUtils.importESModule(
"resource://gre/modules/FirefoxRelayUtils.sys.mjs"
);

Assert.ok(
!FirefoxRelayUtils.relayIsAvailableOrEnabled(),
"FirefoxRelayUtils.relayIsAvailableOrEnabled() should return false when feature is disabled"
);
});

add_task(
async function test_enterprise_relay_autocomplete_not_shown_when_disabled() {
const rsSandbox = await stubRemoteSettingsAllowList();
await BrowserTestUtils.withNewTab(
{
gBrowser,
url: TEST_URL_PATH,
},
async function (browser) {
const popup = document.getElementById("PopupAutoComplete");
await openACPopup(popup, browser, "#form-basic-username");

const relayItem = getRelayItemFromACPopup(popup);
Assert.ok(
!relayItem,
"Relay item SHOULD NOT be present in the autocomplete popup when the feature is disabled"
);
}
);
rsSandbox.restore();
}
);