fix(blocklist): behavioural fixes

This commit is contained in:
Gergő Móricz 2025-02-10 19:10:01 +01:00
parent 3608256569
commit bc787de62a

View File

@ -94,7 +94,7 @@ const allowedKeywords = [
"://www.facebook.com/ads/library", "://www.facebook.com/ads/library",
]; ];
function decryptedBlocklist(list: string[]): string[] { export function decryptedBlocklist(list: string[]): string[] {
return hashKey.length > 0 return hashKey.length > 0
? list.map((ciphertext) => decryptAES(ciphertext, hashKey)) ? list.map((ciphertext) => decryptAES(ciphertext, hashKey))
: []; : [];
@ -148,7 +148,7 @@ export function isUrlBlocked(url: string): boolean {
if ( if (
publicSuffix && publicSuffix &&
blockedlist.some( blockedlist.some(
(blocked) => blocked.startsWith(baseDomain) && blocked !== domain, (blocked) => blocked.startsWith(baseDomain + ".") && blocked !== domain,
) )
) { ) {
return true; return true;