fix(popup): use hostname-aware domain matching to prevent false positives

The noise filter used naive String.includes() on the full URL, causing
blacklist entry 'x.com' to match netflix.com (since 'netflix.com'
contains 'x.com' as substring). This made Netflix tabs disappear when
the filter was enabled.

Fixed by extracting the URL hostname and matching at domain boundaries:
- Domain entries (x.com): hostname === domain || endsWith('.' + domain)
- Prefix entries (amazon.): startsWith || includes('.' + domain)
- Keyword entries (jira): substring fallback on full URL

Release v1.7.5
This commit is contained in:
Koala
2026-05-25 13:26:01 +02:00
parent 2fbeafeb3f
commit 82c09a5328
4 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "KoalaSync",
"version": "1.7.4",
"version": "1.7.5",
"description": "Watch party extension to synchronize video playback on YouTube, Twitch, Netflix, and HTML5 sites in real-time with friends.",
"permissions": [
"storage",
+9 -1
View File
@@ -531,7 +531,15 @@ async function populateTabs(providedPeers = null, providedTargetTabId = null) {
if (!tab.url || tab.url.startsWith('chrome://')) return false;
if (isFilterActive && tab.id !== parseInt(currentTargetTabId)) {
const urlStr = tab.url.toLowerCase();
if (BLACKLIST_DOMAINS.some(d => urlStr.includes(d.toLowerCase()))) return false;
if (BLACKLIST_DOMAINS.some(d => {
const domain = d.toLowerCase();
try {
const hostname = new URL(tab.url).hostname.toLowerCase();
if (domain.endsWith('.')) return hostname.startsWith(domain) || hostname.includes('.' + domain);
if (domain.includes('.')) return hostname === domain || hostname.endsWith('.' + domain);
} catch {}
return urlStr.includes(domain);
})) return false;
}
return true;
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "koalasync",
"version": "1.7.4",
"version": "1.7.5",
"description": "KoalaSync Build Scripts",
"private": true,
"scripts": {
+2 -2
View File
@@ -1,4 +1,4 @@
{
"version": "1.7.4",
"date": "2026-05-25T10:59:16Z"
"version": "1.7.5",
"date": "2026-05-25T14:00:00Z"
}