From f873e1ce837087fc9dd9d1d9c1dd84d8b35ea319 Mon Sep 17 00:00:00 2001 From: Mark Retallack Date: Tue, 10 Nov 2026 21:19:21 +0000 Subject: [PATCH] filter: strip WebLite icon-font glyphs before label matching WebLite appends private-use icon-font glyphs to text labels, e.g. the Sponsored label's textContent is "Sponsored" + U+F078B/U+F17E1. The ad check compared trimmed === 'Sponsored' (and indexOf('Ad')), so sponsored posts were never matched and leaked through, while plain 'Ad' labels were caught. Normalise by stripping PUA glyphs before comparing. --- app/src/main/assets/filter.js | 5 ++++- filter.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/assets/filter.js b/app/src/main/assets/filter.js index 2536d34..31d4545 100644 --- a/app/src/main/assets/filter.js +++ b/app/src/main/assets/filter.js @@ -160,7 +160,10 @@ var el = els[i]; if (el.closest('[data-filtered]')) continue; var text = el.textContent || ''; - var trimmed = text.trim(); + // WebLite appends private-use icon-font glyphs to labels, e.g. the + // "Sponsored" label's textContent is actually "Sponsored" + U+F078B/U+F17E1. + // Strip those so exact-match comparisons below still work. + var trimmed = text.replace(/[\uE000-\uF8FF]|[\u{F0000}-\u{FFFFD}]|[\u{100000}-\u{10FFFD}]/gu, '').trim(); var h = el.getBoundingClientRect().height; // ADS: short element containing "Ad" (not "Add", not "Ads Manager") diff --git a/filter.js b/filter.js index 2536d34..31d4545 100644 --- a/filter.js +++ b/filter.js @@ -160,7 +160,10 @@ var el = els[i]; if (el.closest('[data-filtered]')) continue; var text = el.textContent || ''; - var trimmed = text.trim(); + // WebLite appends private-use icon-font glyphs to labels, e.g. the + // "Sponsored" label's textContent is actually "Sponsored" + U+F078B/U+F17E1. + // Strip those so exact-match comparisons below still work. + var trimmed = text.replace(/[\uE000-\uF8FF]|[\u{F0000}-\u{FFFFD}]|[\u{100000}-\u{10FFFD}]/gu, '').trim(); var h = el.getBoundingClientRect().height; // ADS: short element containing "Ad" (not "Add", not "Ads Manager")