Bug 1263599 fix missing menu items in pocket, r=Gijs

This commit is contained in:
Shane Caraveo 2016-04-25 13:24:17 -07:00
Родитель a148305200
Коммит d7956ba976
1 изменённых файлов: 3 добавлений и 14 удалений

17
browser/extensions/pocket/bootstrap.js поставляемый
Просмотреть файл

@ -59,17 +59,6 @@ function setDefaultPrefs() {
}
}
function* allBrowserWindows() {
var winEnum = Services.wm.getEnumerator("navigator:browser");
while (winEnum.hasMoreElements()) {
let win = winEnum.getNext();
// skip closed windows
if (win.closed)
continue;
yield win;
}
}
function createElementWithAttrs(document, type, attrs) {
let element = document.createElement(type);
Object.keys(attrs).forEach(function (attr) {
@ -221,7 +210,7 @@ var PocketContextMenu = {
Services.obs.removeObserver(this, "on-build-contextmenu");
// loop through windows and remove context menus
// iterate through all windows and add pocket to them
for (let win of allBrowserWindows()) {
for (let win of CustomizableUI.windows) {
let document = win.document;
for (let id of ["context-pocket", "context-savelinktopocket"]) {
let element = document.getElementById(id);
@ -383,7 +372,7 @@ var PocketOverlay = {
CreatePocketWidget(reason);
PocketContextMenu.init();
for (let win of allBrowserWindows()) {
for (let win of CustomizableUI.windows) {
this.onWindowOpened(win);
}
},
@ -391,7 +380,7 @@ var PocketOverlay = {
AboutSaved.unregister();
AboutSignup.unregister();
CustomizableUI.removeListener(this);
for (let window of allBrowserWindows()) {
for (let window of CustomizableUI.windows) {
for (let id of ["panelMenu_pocket", "menu_pocket", "BMB_pocket",
"panelMenu_pocketSeparator", "menu_pocketSeparator",
"BMB_pocketSeparator"]) {