Skip to content

Commit 4ff6a9f

Browse files
Throw away requests that are not in the default cookie store or requests that we can't be certain what cookie store they are in (#207)
1 parent 3490881 commit 4ff6a9f

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

js/capture.js

+17
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,37 @@ const capture = {
8282
async shouldStore(info) {
8383
const tabId = info.id || info.tabId;
8484
let documentUrl, privateBrowsing;
85+
// Ignore container tabs as we need to store them correctly
86+
// showing a simpler graph just for default means we won't confuse users
87+
// into thinking isolation has broken
88+
const defaultCookieStore = 'firefox-default';
89+
if ('cookieStoreId' in info
90+
&& info.cookieStoreId !== defaultCookieStore) {
91+
return false;
92+
}
8593
if (this.isVisibleTab(tabId)) {
8694
const tab = await this.getTab(tabId);
8795
if (!tab) {
8896
return;
8997
}
98+
if (tab.cookieStoreId !== defaultCookieStore) {
99+
return false;
100+
}
90101
documentUrl = new URL(tab.url);
91102
privateBrowsing = tab.incognito;
92103
} else {
104+
// if we were not able to check the cookie store
105+
// lets drop this for paranoia sake.
106+
if (!('cookieStoreId' in info)) {
107+
return false;
108+
}
93109
// browser.tabs.get throws an error for nonvisible tabs (tabId = -1)
94110
// but some non-visible tabs can make third party requests,
95111
// ex: Service Workers
96112
documentUrl = new URL(info.originUrl);
97113
privateBrowsing = false;
98114
}
115+
99116
// ignore about:*, moz-extension:*
100117
// also ignore private browsing tabs
101118
if (documentUrl.protocol !== 'about:'

manifest.json

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"webRequest",
1616
"<all_urls>",
1717
"tabs",
18+
"cookies",
1819
"storage",
1920
"downloads",
2021
"privacy"

0 commit comments

Comments
 (0)