Skip to content

Instantly share code, notes, and snippets.

@jaredhirsch
Created March 28, 2017 22:26
Show Gist options
  • Save jaredhirsch/d5d1971cbe3bd4942d366a07707e1532 to your computer and use it in GitHub Desktop.
Save jaredhirsch/d5d1971cbe3bd4942d366a07707e1532 to your computer and use it in GitHub Desktop.
Patch that fixes browser/ test breakage
diff --git a/browser/components/customizableui/CustomizableUI.jsm b/browser/components/customizableui/CustomizableUI.jsm
index aee38b72af35..cffbd5942c1d 100644
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -257,6 +257,20 @@ var CustomizableUIInternal = {
navbarPlacements.push("pocket-button");
}
+ function _screenshotsDisabled() {
+ return (Services.prefs.getPrefType("extensions.screenshots.system-disabled") &&
+ Services.prefs.getBoolPref("extensions.screenshots.system-disabled")) ||
+ (Services.prefs.getPrefType("extensions.screenshots.disabled") &&
+ Services.prefs.getBoolPref("extensions.screenshots.disabled"));
+ }
+
+ // 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 (!_screenshotsDisabled()) {
+ navbarPlacements.push("screenshots_mozilla_org-browser-action");
+ }
+
this.registerArea(CustomizableUI.AREA_NAVBAR, {
legacy: true,
type: CustomizableUI.TYPE_TOOLBAR,
diff --git a/browser/components/extensions/test/browser/browser_ext_contextMenus_chrome.js b/browser/components/extensions/test/browser/browser_ext_contextMenus_chrome.js
index 12af94ba3bcc..7cb93c0c7532 100644
--- a/browser/components/extensions/test/browser/browser_ext_contextMenus_chrome.js
+++ b/browser/components/extensions/test/browser/browser_ext_contextMenus_chrome.js
@@ -102,7 +102,7 @@ add_task(function* test_tabContextMenu() {
yield second.awaitMessage("ready");
const menu = yield openTabContextMenu();
- const [separator, submenu, gamma] = Array.from(menu.children).slice(-3);
+ const [separator, screenshots, submenu, gamma] = Array.from(menu.children).slice(-4);
is(separator.tagName, "menuseparator", "Separator before first extension item");
is(submenu.tagName, "menu", "Correct submenu type");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment