Bug 1358097 - Add Screenshots to the navbar placements for Customizable UI when Screenshots is enabled. r?Gijs
MozReview-Commit-ID: 3ZEFZZhqt6s
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -252,16 +252,24 @@ var CustomizableUIInternal = {
// Place this last, when createWidget is called for pocket, it will
// append to the toolbar.
if (Services.prefs.getPrefType("extensions.pocket.enabled") != Services.prefs.PREF_INVALID &&
Services.prefs.getBoolPref("extensions.pocket.enabled")) {
navbarPlacements.push("pocket-button");
}
+ // Firefox Screenshots is a WebExtension, and WebExtensions place buttons
+ // at the end of the toolbar. Apparently this happens after pocket's
+ // createWidget call (see previous comment).
+ if (!Services.prefs.getBoolPref("extensions.screenshots.disabled", false) &&
+ !Services.prefs.getBoolPref("extensions.screenshots.system-disabled", false)) {
+ navbarPlacements.push("screenshots_mozilla_org-browser-action");
+ }
+
this.registerArea(CustomizableUI.AREA_NAVBAR, {
legacy: true,
type: CustomizableUI.TYPE_TOOLBAR,
overflowable: true,
defaultPlacements: navbarPlacements,
defaultCollapsed: false,
}, true);