Substring URL match in broadcastPatreonStatus can target non-YouTube tabs
Problem
tab.url.includes("youtube.com") uses substring matching instead of hostname parsing, so tabs whose URL merely contains youtube.com anywhere (path/query/fragment/hostname suffix) are included in the Patreon-status broadcast loop.
Read cite
Extensions/combined/ryd.background.js:21
.filter((tab) => tab.url && tab.url.includes("youtube.com"))Steps
- Open a tab with URL
https://example.com/?ref=youtube.com. - Trigger Patreon auth (or reload the extension while authenticated).
broadcastPatreonStatusiterates that tab and callschrome.tabs.sendMessageon it.
Expected
Only tabs whose hostname is youtube.com or *.youtube.com are considered. Use new URL(tab.url).hostname and check === "youtube.com" || endsWith(".youtube.com").
Actual
Any tab whose full URL string contains the literal youtube.com is included. The sendMessage currently fails silently on non-YouTube tabs (no content-script receiver), but the filter is still incorrect and the chrome.runtime.lastError path is exercised for every false-positive tab on each broadcast.
Environment
Repo: Anarios/return-youtube-dislike @ main. Extension package.json version 4.0.4. Node .nvmrc v22.17.0. manifest-chrome.json MV3.
Thanks for maintaining Anarios/return-youtube-dislike!
Source: Anarios/return-youtube-dislike