Bug 1778722 - Hide existing "Add-ons and themes" widget when "unifiedExtensions" pref is set. r=rpl
Note: the pref now requires a restart. Depends on D151497 Differential Revision: https://phabricator.services.mozilla.com/D151699
This commit is contained in:
@@ -296,6 +296,12 @@ const CustomizableWidgets = [
|
||||
id: "add-ons-button",
|
||||
shortcutId: "key_openAddons",
|
||||
l10nId: "toolbar-addons-themes-button",
|
||||
onBeforeCreated() {
|
||||
// If the pref is set to `true`, we won't create this widget.
|
||||
return !Services.prefs.getBoolPref(
|
||||
"extensions.unifiedExtensions.enabled"
|
||||
);
|
||||
},
|
||||
onCommand(aEvent) {
|
||||
let win = aEvent.target.ownerGlobal;
|
||||
win.BrowserOpenAddonsMgr();
|
||||
|
||||
Reference in New Issue
Block a user