From 82c09a5328fcd5572d399e3eb0b4658b6fa0fe10 Mon Sep 17 00:00:00 2001 From: Koala <6156589+Shik3i@users.noreply.github.com> Date: Mon, 25 May 2026 13:26:01 +0200 Subject: [PATCH] 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 --- extension/manifest.base.json | 2 +- extension/popup.js | 10 +++++++++- package.json | 2 +- website/version.json | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/extension/manifest.base.json b/extension/manifest.base.json index e08b5b7..d08d492 100644 --- a/extension/manifest.base.json +++ b/extension/manifest.base.json @@ -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", diff --git a/extension/popup.js b/extension/popup.js index 46d3abd..f0466f0 100644 --- a/extension/popup.js +++ b/extension/popup.js @@ -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; }); diff --git a/package.json b/package.json index 564c83f..d5e52d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "koalasync", - "version": "1.7.4", + "version": "1.7.5", "description": "KoalaSync Build Scripts", "private": true, "scripts": { diff --git a/website/version.json b/website/version.json index c20490c..6026281 100644 --- a/website/version.json +++ b/website/version.json @@ -1,4 +1,4 @@ { - "version": "1.7.4", - "date": "2026-05-25T10:59:16Z" + "version": "1.7.5", + "date": "2026-05-25T14:00:00Z" }