Add comment & live-chat scam/spam filtering — v1.9.0 (F2) #23

Merged
365DevNet merged 1 commit from refs/pull/23/head into main 2026-06-13 20:22:34 +02:00
365DevNet commented 2026-06-13 20:15:45 +02:00 (Migrated from codeberg.org)

What

Adds comment & live-chat scam/spam filtering (roadmap F2), bumping the extension to v1.9.0.

A new Comment & chat filtering section (Settings → Focus & Limits) hides comments whose text or author matches a filter. Under the master Filter scam & spam comments toggle:

  • Use built-in scam phrase pack (on by default once filtering is enabled) — a curated, local list of phrases common in YouTube comment scams: giveaway/impersonation (free crypto, Elon Musk giveaway), fake investment "advisors" (investment advisor, made me rich), and off-platform contact lures (text me on Telegram, t.me/, whatsapp me).
  • Also apply my keyword blocklist — additionally hides comments matching the same keyword list (plain text and /regex/) you already manage in the Dashboard. No second list to maintain.
  • Filter live chat too — applies the same filters to live-stream chat messages.

How

  • Matcher + scam pack live in defaults.js (FY_MATCHES_COMMENT_FILTERS, FY_COMMENT_SCAM_PRESET) so identical logic runs in both frames.
  • Main frame: applyCommentFilters() in content.js iterates ytd-comment-thread-renderer, reads the top comment's #content-text + #author-text, and hides the whole thread via the existing managed-hide mechanism.
  • Live chat is an iframe, so a dedicated lightweight content script livechat.js is registered for *://www.youtube.com/live_chat* with all_frames: true; it reads the same settings from chrome.storage.local and filters yt-live-chat-text-message-renderer rows.
  • Local only — no comment text leaves the device. All settings default off.
  • Strings localized in EN, NL, DE, FR. Website download zip rebuilt with livechat.js.

Testing

  • Node unit tests for the matcher: 16/16 (substring, /regex/, broken-regex safety, preset hits, no over-match on normal text).
  • Live-DOM integration probe on a real video: 99/99 comment threads extracted, 0 false positives on normal comments, a planted scam comment caught end-to-end.
  • ⚠️ Live-chat filtering could not be exercised headless (needs an actual live stream) — flagged for manual smoke. Note hideLiveChat defaults to true, so chat filtering only applies for users who re-enable chat.

🤖 Generated with Claude Code

## What Adds **comment & live-chat scam/spam filtering** (roadmap F2), bumping the extension to **v1.9.0**. A new **Comment & chat filtering** section (Settings → Focus & Limits) hides comments whose text or author matches a filter. Under the master **Filter scam & spam comments** toggle: - **Use built-in scam phrase pack** (on by default once filtering is enabled) — a curated, local list of phrases common in YouTube comment scams: giveaway/impersonation (`free crypto`, `Elon Musk giveaway`), fake investment "advisors" (`investment advisor`, `made me rich`), and off-platform contact lures (`text me on Telegram`, `t.me/`, `whatsapp me`). - **Also apply my keyword blocklist** — additionally hides comments matching the same keyword list (plain text and `/regex/`) you already manage in the Dashboard. No second list to maintain. - **Filter live chat too** — applies the same filters to live-stream chat messages. ## How - Matcher + scam pack live in `defaults.js` (`FY_MATCHES_COMMENT_FILTERS`, `FY_COMMENT_SCAM_PRESET`) so identical logic runs in both frames. - Main frame: `applyCommentFilters()` in `content.js` iterates `ytd-comment-thread-renderer`, reads the top comment's `#content-text` + `#author-text`, and hides the whole thread via the existing managed-hide mechanism. - Live chat is an iframe, so a dedicated lightweight content script `livechat.js` is registered for `*://www.youtube.com/live_chat*` with `all_frames: true`; it reads the same settings from `chrome.storage.local` and filters `yt-live-chat-text-message-renderer` rows. - **Local only** — no comment text leaves the device. All settings default off. - Strings localized in EN, NL, DE, FR. Website download zip rebuilt with `livechat.js`. ## Testing - Node unit tests for the matcher: **16/16** (substring, `/regex/`, broken-regex safety, preset hits, no over-match on normal text). - Live-DOM integration probe on a real video: **99/99** comment threads extracted, **0 false positives** on normal comments, a planted scam comment caught end-to-end. - ⚠️ Live-chat filtering could not be exercised headless (needs an actual live stream) — flagged for manual smoke. Note `hideLiveChat` defaults to `true`, so chat filtering only applies for users who re-enable chat. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
365DevNet/CleanWatch!23
No description provided.