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 14, 2016
1 parent 0d4855c commit db90b3f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ var closeDownloadTabs = {
return;
this.initialized = true;

for(var window in this.windows)
this.windows.forEach(function(window) {
this.initWindow(window, reason);
}, this);
Services.ww.registerNotification(this);

if(reason != APP_STARTUP)
Expand All @@ -49,8 +50,9 @@ var closeDownloadTabs = {
this.initialized = false;

this.initConsoleListener(false);
for(var window in this.windows)
this.windows.forEach(function(window) {
this.destroyWindow(window, reason);
}, this);
Services.ww.unregisterNotification(this);

for(var id in this._handlers) {
Expand Down Expand Up @@ -108,13 +110,15 @@ var closeDownloadTabs = {
return this.isSeaMonkey = Services.appinfo.name == "SeaMonkey";
},
get windows() {
var windows = [];
var isSeaMonkey = this.isSeaMonkey;
var ws = Services.wm.getEnumerator(isSeaMonkey ? null : "navigator:browser");
while(ws.hasMoreElements()) {
var window = ws.getNext();
if(!isSeaMonkey || this.isTargetWindow(window))
yield window;
windows.push(window);
}
return windows;
},
isTargetWindow: function(window) {
// Note: we don't have "windowtype" attribute for private windows in SeaMonkey 2.19+
Expand Down

0 comments on commit db90b3f

Please sign in to comment.