- commit
- 4114fc00694b0cff0de40580623f6dccb3606792
- parent
- 8d27037f5ca1a9a3068853c66d09fa83e411974e
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2022-08-01 19:46
fix: include subdomains in first-party rule
Diffstat
| M | src/shared.js | 6 | +++--- |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shared.js b/src/shared.js
@@ -16,14 +16,14 @@ shared.TYPE_MAP = {
16 16
17 17 shared.shouldAllow = function(rules, context, hostname, type) {
18 18 var hostnames = ['*', hostname];
19 -1 if (context === hostname && context !== '*') {
20 -1 hostnames.push('first-party');
21 -1 }
22 19 var parts = hostname.split('.');
23 20 while (parts.length > 2) {
24 21 parts.shift();
25 22 hostnames.push(parts.join('.'));
26 23 }
-1 24 if (context !== '*' && hostnames.some(h => h === context)) {
-1 25 hostnames.push('first-party');
-1 26 }
27 27
28 28 return [context, '*'].some(c => {
29 29 return rules[c] && hostnames.some(h => {