[TabGuard] Stop exempting domains bidirectionally by default.

This commit is contained in:
hackademix 2023-06-28 16:32:20 +02:00
parent 3cd1a6049d
commit db06a6a252
No known key found for this signature in database
GPG Key ID: 231A83AFDA9C2434
1 changed files with 9 additions and 7 deletions

View File

@ -36,16 +36,18 @@ var TabGuard = (() => {
}; };
forget(); forget();
function mergeGroups(groups, {tabDomain, otherDomains} /* anonymizedTabInfo */) { function mergeGroups(groups,
if (!(tabDomain in groups)) groups[tabDomain] = new Set(); {tabDomain, otherDomains}, /* anonymizedTabInfo */
let currentGroup = groups[tabDomain]; bidirectional = false) {
const currentGroup = groups[tabDomain] || (groups[tabDomain] = new Set());
for (let d of otherDomains) { for (let d of otherDomains) {
if (!(d in groups)) groups[d] = new Set();
// add this domain to the allow/block group of the other tied ones...
groups[d].add(tabDomain);
// ... and vice-versa
currentGroup.add(d); currentGroup.add(d);
} }
if (bidirectional) {
for (let d of otherDomains) {
(groups[d] || (groups[d] = new Set())).add(tabDomain);
}
}
} }
const AUTH_HEADERS_RX = /^(?:authorization|cookie)/i; const AUTH_HEADERS_RX = /^(?:authorization|cookie)/i;