Skip to content

Commit

Permalink
Fix this.windows getter in Firefox 51.0a1+
Browse files Browse the repository at this point in the history
(SyntaxError: non-generator method definitions may not contain yield)
(see Infocatcher/Private_Tab#228)
  • Loading branch information
Infocatcher committed Aug 11, 2016
1 parent fe4d589 commit b0a6571
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var dpTweaker = {
_dbg = prefs.get("debug", false);
_dbgv = prefs.get("debug.verbose", false);

for(var window in this.windows)
for(var window of this.windows)
this.initWindow(window, reason);
if(!this._tweakStyleLoaded && Services.wm.getMostRecentWindow("Places:Organizer"))
this.stl.loadStyles(true);
Expand Down Expand Up @@ -81,7 +81,7 @@ var dpTweaker = {
}.bind(this), "profile-change-teardown", false);
}

for(var window in this.windows)
for(var window of this.windows)
this.destroyWindow(window, reason);
Services.ww.unregisterNotification(this);

Expand Down Expand Up @@ -192,9 +192,11 @@ var dpTweaker = {
return window.document.documentElement.getAttribute("windowtype") == "Places:Organizer";
},
get windows() {
var windows = [];
var ws = Services.wm.getEnumerator("navigator:browser");
while(ws.hasMoreElements())
yield ws.getNext();
windows.push(ws.getNext());
return windows;
},

get stl() { return this.lazy("stl", "downloadsStyles"); },
Expand Down Expand Up @@ -592,13 +594,13 @@ var dpTweaker = {
this.stl.loadCompactStyle(pVal);
else if(pName == "showDownloadRate") {
this.showDownloadRate(pVal);
for(var window in this.windows)
for(var window of this.windows)
this.udateDownloadRate(window.document, pVal);
}
else if(pName == "itemCountLimit") {
if(this.wrongPref(pName, pVal, this.minItemCountLimit, 10e3))
return;
for(var window in this.windows)
for(var window of this.windows)
this.setItemCountLimit(window, true);
}
else if(
Expand All @@ -618,7 +620,7 @@ var dpTweaker = {
return;
if(pName == "decolorizePausedProgress") {
this.showPausedDownloadsSummary(pVal);
for(var window in this.windows)
for(var window of this.windows)
this.updateDownloadsSummary(window.document, pVal);
}
this.stl.reloadTweakStyleProxy();
Expand All @@ -636,7 +638,7 @@ var dpTweaker = {
+ ", handleCommandEvent = " + handleCommand
+ ", handleClickEvent = " + handleClick
);
for(var window in this.windows) {
for(var window of this.windows) {
if(handleCommand)
window.addEventListener("command", this, true);
else
Expand All @@ -657,14 +659,14 @@ var dpTweaker = {
else if(pName == "fixDownloadsLoading")
this.de.fixLoadDownloads(pVal && prefs.get("dontRemoveFinishedDownloads"));
else if(pName == "fixWrongTabsOnTopAttribute") {
for(var window in this.windows)
for(var window of this.windows)
this.setFixToolbox(window, pVal, true);
}
else if(
pName == "dontHighlightButton"
|| pName == "menuButtonBehavior"
) {
for(var window in this.windows)
for(var window of this.windows)
this.btn.tweakDlButton(window, this.enableDlButtonTweaks, true);
}
else if(pName == "debug")
Expand Down

0 comments on commit b0a6571

Please sign in to comment.