Bug 1715838 - Creates preference for new screenshot components. r=emalysz

Differential Revision: https://phabricator.services.mozilla.com/D117654
This commit is contained in:
Kajal Sah 2021-06-21 15:07:47 +00:00
parent 4c923c87d0
commit 371a34a387
3 changed files with 23 additions and 2 deletions

View File

@ -2040,6 +2040,9 @@ pref("browser.suppress_first_window_animation", true);
// Preference that allows individual users to disable Screenshots.
pref("extensions.screenshots.disabled", false);
// Preference that determines whether Screenshots is opened as a dedicated browser component
pref("screenshots.browser.component.enabled", false);
// DoH Rollout: whether to enable automatic performance-based TRR-selection.
// This pref is controlled by a Normandy rollout so we don't overload providers.
pref("doh-rollout.trr-selection.enabled", false);

View File

@ -1291,7 +1291,9 @@ class nsContextMenu {
}
takeScreenshot() {
Services.obs.notifyObservers(null, "menuitem-screenshot", true);
if (!SCREENSHOT_BROWSER_COMPONENT) {
Services.obs.notifyObservers(null, "menuitem-screenshot", true);
}
}
// View Partial Source
@ -2226,3 +2228,10 @@ XPCOMUtils.defineLazyPreferenceGetter(
"extensions.screenshots.disabled",
false
);
XPCOMUtils.defineLazyPreferenceGetter(
this,
"SCREENSHOT_BROWSER_COMPONENT",
"screenshots.browser.component.enabled",
false
);

View File

@ -53,6 +53,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
false
);
XPCOMUtils.defineLazyPreferenceGetter(
this,
"SCREENSHOT_BROWSER_COMPONENT",
"screenshots.browser.component.enabled",
false
);
function setAttributes(aNode, aAttrs) {
let doc = aNode.ownerDocument;
for (let [name, value] of Object.entries(aAttrs)) {
@ -502,7 +509,9 @@ if (!screenshotsDisabled) {
id: "screenshot-button",
l10nId: "screenshot-toolbarbutton",
onCommand(aEvent) {
Services.obs.notifyObservers(null, "menuitem-screenshot");
if (!SCREENSHOT_BROWSER_COMPONENT) {
Services.obs.notifyObservers(null, "menuitem-screenshot");
}
},
onCreated(aNode) {
aNode.ownerGlobal.MozXULElement.insertFTLIfNeeded(