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 13, 2016
1 parent 82b4d00 commit 5239663
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 @@ -72,8 +72,9 @@ var bmFilter = {
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 @@ -84,8 +85,9 @@ var bmFilter = {
return;
this.initialized = false;

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

if(reason != APP_SHUTDOWN)
Expand Down Expand Up @@ -176,13 +178,15 @@ var bmFilter = {
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 5239663

Please sign in to comment.