Skip to content

Commit 24f7383

Browse files
committed
Fixed issue #35 "tabId is not defined" on startup.
1 parent 6860ee2 commit 24f7383

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/bg/deferWebTraffic.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function deferWebTraffic(promiseToWaitFor, next) {
66
let seen = seenTabs.has(nav.tabId);
77
debug(`%s navigation %o`, seen ? "seen" : "unseen", nav);
88
if (!seen) {
9-
reloadTab(tabId);
9+
reloadTab(nav.tabId);
1010
}
1111
}
1212
}
@@ -23,7 +23,7 @@ function deferWebTraffic(promiseToWaitFor, next) {
2323
error(e, "Can't reload tab", tabId);
2424
}
2525
}
26-
26+
2727
async function waitFor(request) {
2828
let {type, documentUrl, url, tabId, frameId} = request;
2929
if (tabId === browser.tabs.TAB_ID_NONE) return;
@@ -45,9 +45,9 @@ function deferWebTraffic(promiseToWaitFor, next) {
4545
}
4646
debug("Green light to %s %s from %s", type, url, documentUrl);
4747
}
48-
48+
4949
function spyTabs(request) {
50-
debug("Spying request %o", request);
50+
debug("Spying request %o", request);
5151
}
5252

5353
browser.webRequest.onHeadersReceived.addListener(spyTabs, {
@@ -57,12 +57,12 @@ function deferWebTraffic(promiseToWaitFor, next) {
5757
browser.webRequest.onBeforeRequest.addListener(waitFor, {
5858
urls: ["<all_urls>"]
5959
}, ["blocking"]);
60-
60+
6161
(async () => {
6262
await promiseToWaitFor;
6363
browser.webNavigation.onCommitted.removeListener(checkNavigation);
6464
browser.webRequest.onBeforeRequest.removeListener(waitFor);
6565
browser.webRequest.onHeadersReceived.removeListener(spyTabs);
6666
if (next) next();
6767
})();
68-
}
68+
}

0 commit comments

Comments
 (0)