Bug 1994791 - Chatbot policy should turn off context menu. a=pascalc DONTBUILD

Original Revision: https://phabricator.services.mozilla.com/D269272

Differential Revision: https://phabricator.services.mozilla.com/D270676
This commit is contained in:
Michael Kaply
2025-10-30 15:11:21 +00:00
committed by pchevrel@mozilla.com
parent 3a7afc8674
commit 0a0e35c404
2 changed files with 24 additions and 5 deletions

View File

@@ -1581,17 +1581,19 @@ export var Policies = {
const defaultValue = "Enabled" in param ? param.Enabled : undefined;
const features = [
["Chatbot", "browser.ml.chat.enabled"],
["LinkPreviews", "browser.ml.linkPreview.optin"],
["TabGroups", "browser.tabs.groups.smart.userEnabled"],
["Chatbot", ["browser.ml.chat.enabled", "browser.ml.chat.page"]],
["LinkPreviews", ["browser.ml.linkPreview.optin"]],
["TabGroups", ["browser.tabs.groups.smart.userEnabled"]],
];
for (const [key, pref] of features) {
for (const [key, prefs] of features) {
const value = key in param ? param[key] : defaultValue;
if (value !== undefined) {
for (const pref of prefs) {
PoliciesUtils.setDefaultPref(pref, value, param.Locked);
}
}
}
},
},

View File

@@ -1199,6 +1199,23 @@ const POLICIES_TESTS = [
"security.webauthn.always_allow_direct_attestation": true,
},
},
// GenerativeAI
{
policies: {
GenerativeAI: {
Enabled: false,
Chatbot: true,
Locked: true,
},
},
lockedPrefs: {
"browser.ml.chat.enabled": true,
"browser.ml.chat.page": true,
"browser.ml.linkPreview.optin": false,
"browser.tabs.groups.smart.userEnabled": false,
},
},
];
add_task(async function test_policy_simple_prefs() {