Skip to content

Commit 30e0b15

Browse files
mkaplyDonalMe
authored andcommitted
Bug 2013938 - Update policies to work correctly with AI kill switch. a=dmeehan DONTBUILD
Original Revision: https://phabricator.services.mozilla.com/D281505 Differential Revision: https://phabricator.services.mozilla.com/D282020
1 parent fa76242 commit 30e0b15

2 files changed

Lines changed: 22 additions & 5 deletions

File tree

‎browser/components/enterprisepolicies/Policies.sys.mjs‎

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,17 +1673,34 @@ export var Policies = {
16731673
const defaultValue = "Enabled" in param ? param.Enabled : undefined;
16741674

16751675
const features = [
1676-
["Chatbot", ["browser.ml.chat.enabled", "browser.ml.chat.page"]],
1677-
["LinkPreviews", ["browser.ml.linkPreview.optin"]],
1678-
["TabGroups", ["browser.tabs.groups.smart.userEnabled"]],
1676+
[
1677+
"Chatbot",
1678+
["browser.ml.chat.enabled", "browser.ml.chat.page"],
1679+
"browser.ai.control.sidebarChatbot",
1680+
],
1681+
[
1682+
"LinkPreviews",
1683+
["browser.ml.linkPreview.optin"],
1684+
"browser.ai.control.linkPreviewKeyPoints",
1685+
],
1686+
[
1687+
"TabGroups",
1688+
["browser.tabs.groups.smart.userEnabled"],
1689+
"browser.ai.control.smartTabGroups",
1690+
],
16791691
];
16801692

1681-
for (const [key, prefs] of features) {
1693+
for (const [key, prefs, aiControlPref] of features) {
16821694
const value = key in param ? param[key] : defaultValue;
16831695
if (value !== undefined) {
16841696
for (const pref of prefs) {
16851697
PoliciesUtils.setDefaultPref(pref, value, param.Locked);
16861698
}
1699+
PoliciesUtils.setDefaultPref(
1700+
aiControlPref,
1701+
value ? "enabled" : "blocked",
1702+
param.Locked
1703+
);
16871704
}
16881705
}
16891706
},

‎toolkit/components/pdfjs/content/PdfJsAIFeature.sys.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ export class PdfJsGuessAltTextFeature extends AIFeature {
8989
}
9090

9191
static get isManagedByPolicy() {
92-
return false;
92+
return Services.prefs.prefIsLocked("pdfjs.enableAltText");
9393
}
9494
}

0 commit comments

Comments
 (0)