Bug 1245074 workaround CUI defaults for pocket to fix restore defaults, r=gijs

This commit is contained in:
Shane Caraveo
2016-03-22 12:43:38 -07:00
parent 724045b436
commit 1820b4c664
3 changed files with 10 additions and 1 deletions

View File

@@ -1675,3 +1675,5 @@ pref("browser.laterrun.enabled", false);
// Enable browser frames for use on desktop. Only exposed to chrome callers.
pref("dom.mozBrowserFramesEnabled", true);
pref("extensions.pocket.enabled", true);

View File

@@ -249,6 +249,13 @@ var CustomizableUIInternal = {
navbarPlacements.push("webide-button");
}
// 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");
}
this.registerArea(CustomizableUI.AREA_NAVBAR, {
legacy: true,
type: CustomizableUI.TYPE_TOOLBAR,

View File

@@ -224,7 +224,7 @@ var PocketContextMenu = {
// iterate through all windows and add pocket to them
for (let win of allBrowserWindows()) {
let document = win.document;
for (let id in ["context-pocket", "context-savelinktopocket"]) {
for (let id of ["context-pocket", "context-savelinktopocket"]) {
let element = document.getElementById(id);
if (element)
element.remove();