diff --git a/src/ext/uw-bg.js b/src/ext/uw-bg.js index 2649734..2dad303 100644 --- a/src/ext/uw-bg.js +++ b/src/ext/uw-bg.js @@ -53,7 +53,6 @@ class UWServer { } scheduleGc(timeout) { - console.log("scheduling gcframe") if (this._gctimeout) { return; } @@ -122,19 +121,22 @@ class UWServer { async gcFrames() { // does "garbage collection" on frames + let frames; if (BrowserDetect.firefox) { frames = await browser.webNavigation.getAllFrames({tabId: this.currentTabId}); } else if (BrowserDetect.chrome) { frames = await new Promise( (resolve, reject) => { - chrome.webNavigation.getAllFrames({tabId: this.currentTabId}, (data) => resolve(data) ); + chrome.webNavigation.getAllFrames({tabId: this.currentTabId}, (data) => {resolve(data); return true}); }); } - for (let key in this.videoTabs[this.currentTabId].frames) { - if (! frames.find(x => x.frameId == key)) { - delete this.videoTabs[this.currentTabId].frames[key]; + if (this.videoTabs[this.currentTabId]) { + for (let key in this.videoTabs[this.currentTabId].frames) { + if (! frames.find(x => x.frameId == key)) { + delete this.videoTabs[this.currentTabId].frames[key]; + } } } } diff --git a/src/options/options.html b/src/options/options.html index 3fe974f..58247d6 100644 --- a/src/options/options.html +++ b/src/options/options.html @@ -2,7 +2,7 @@
-