Bug 1778559 - Just disable addon button if policy forbids extension installation. r=devtools-reviewers,jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D248342
This commit is contained in:
Michael Kaply
2025-05-08 23:10:19 +00:00
committed by mozilla@kaply.com
parent 91dce4674b
commit 239f898fd3
2 changed files with 3 additions and 3 deletions

View File

@@ -1330,8 +1330,7 @@ export var Policies = {
"extensions.htmlaboutaddons.recommendations.enable",
false
);
// Block about:debugging
blockAboutPage(manager, "about:debugging");
manager.disallowFeature("installTemporaryAddon");
}
if ("restricted_domains" in extensionSettings["*"]) {
let restrictedDomains = Services.prefs
@@ -1661,7 +1660,7 @@ export var Policies = {
if ("Default" in param) {
setAndLockPref("xpinstall.enabled", param.Default);
if (!param.Default) {
blockAboutPage(manager, "about:debugging");
manager.disallowFeature("installTemporaryAddon");
setAndLockPref(
"browser.newtabpage.activity-stream.asrouter.userprefs.cfr.addons",
false

View File

@@ -42,6 +42,7 @@ class TemporaryExtensionInstaller extends PureComponent {
{
className: `${className} default-button qa-temporary-extension-install-button`,
onClick: () => this.install(),
disabled: !Services.policies.isAllowed("installTemporaryAddon"),
},
"Load Temporary Add-on…"
)