From 9283a29d35a18f058f3c84f8aaa919b911f1940a Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 7 Dec 2018 15:41:43 -0500 Subject: [PATCH] Domain match blacklist --- src/services/cipher.service.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/services/cipher.service.ts b/src/services/cipher.service.ts index 20538d3ab0..3f54ffa718 100644 --- a/src/services/cipher.service.ts +++ b/src/services/cipher.service.ts @@ -52,6 +52,10 @@ const Keys = { neverDomains: 'neverDomains', }; +const DomainMatchBlacklist = new Map>([ + ['google.com', new Set(['script.google.com'])], +]); + export class CipherService implements CipherServiceAbstraction { // tslint:disable-next-line _decryptedCipherCache: CipherView[]; @@ -352,7 +356,14 @@ export class CipherService implements CipherServiceAbstraction { case undefined: case UriMatchType.Domain: if (domain != null && u.domain != null && matchingDomains.indexOf(u.domain) > -1) { - return true; + if (DomainMatchBlacklist.has(u.domain)) { + const domainUrlHost = Utils.getHost(url); + if (!DomainMatchBlacklist.get(u.domain).has(domainUrlHost)) { + return true; + } + } else { + return true; + } } break; case UriMatchType.Host: