fix(extension): support Google Drive video frames

This commit is contained in:
Timo
2026-07-26 03:52:05 +02:00
parent 90a58eb507
commit 213d2867fc
13 changed files with 852 additions and 112 deletions
+22
View File
@@ -0,0 +1,22 @@
function hostnameMatchesDomain(hostname, domain) {
const normalizedHostname = String(hostname || '').toLowerCase();
const normalizedDomain = String(domain || '').toLowerCase();
return normalizedDomain
&& (normalizedHostname === normalizedDomain
|| normalizedHostname.endsWith(`.${normalizedDomain}`));
}
export function isTabUrlFiltered(url, blacklistDomains, allowlistDomains = []) {
const urlString = String(url || '');
try {
const hostname = new URL(urlString).hostname.toLowerCase();
if (allowlistDomains.some(domain => hostnameMatchesDomain(hostname, domain))) {
return false;
}
return blacklistDomains.some(domain => hostnameMatchesDomain(hostname, domain));
} catch {
const normalizedUrl = urlString.toLowerCase();
return blacklistDomains.some(domain => normalizedUrl.includes(String(domain).toLowerCase()));
}
}