These items are intentionally on hold. Captured here so they are not forgotten, but not part of the current release.
Higher false-positive risk than domain-level work. Needs design review before implementation. Sub-tasks:
- Keep the hostname filter as the primary defense. Page-level scan is a fallback for clean-domain doorway pages.
- Look at more page signals:
<title>,<meta>, first body lines, imagealt/aria-label. - Phrase-first matching for CJK / Arabic / Thai (no whitespace in those scripts).
- Conservative thresholds: one strong explicit phrase = block; one weak word alone = don't block, but 3+ weak signals co-occurring = block.
- Keep the safe-context bypass for recovery / education / support pages.
- IDN / punycode exact-domain block works on a known
xn--adult site. - Host-keyword block works on a non-English hostname not in the blocklist.
- Sparse / image-heavy pages still block on hostname alone.
- Support / recovery / education pages are NOT blocked.
- No English regression: known English adult sites still block.
dnsFilterEnabledstays optional.
- Do not add generic page language detection.
- Do not block on broad Unicode substring matches alone.
- Do not trust DNS filtering as the only protection layer for non-English sites.
IDN / Punycode exact-domain coverage
- Fixed
isLikelyDomain()regex that was silently droppingxn--prefixed hostnames. All 93 punycode entries already present indata/HOSTS.txtare now retained and used at runtime. - Added a browser-safe punycode / IDN decoder in
shared/hostname.js(RFC 3492) so the smart filter can scan the decoded Unicode form of a hostname, not just the ASCII / punycode form.
Multilingual hostname smart filter
- Curation now splits keywords into two classes:
STRONG_HOST_KEYWORDS(used by the filter)AMBIGUOUS_HOST_KEYWORDS(documentation-only reject list with reasons - prevents future accidental additions ofsex,jav,cam,tube,video,live, etc.)
- New non-Latin adult tokens:
色情(Chinese),야동(Korean),порно(Russian),سكس(Arabic),หนังโป๊(Thai). - Plus transliterated Latin tokens:
bokep(Indonesian),yadong(Korean),seks(Polish / Turkish),sikis(Turkish). - Strict matching rules: whole-label match, hyphen-bounded match, no
broad substring match for adult tokens.
essex.comstill does NOT matchsex(sex is not even a strong token);pornreports.comdoes NOT matchporn;my-porn-tube.comdoes NOT match becausepornis mid-label, not at a boundary. - Safe-host bypass (
SAFE_HOST_TOKENS) preserved and now shared between the service worker and the content script, so aporn-recovery.orgis correctly NOT blocked.
Data pipeline
data/HOSTS.txtgained a 27-line curation policy header.data/SOURCE_NOTES.txtgained "Curation rules", "Missed-site reporting flow", and "Packaged fallback" sections.blocklist.jsonregenerated from the curated source. Deduplicated and validity-filtered - 58,075 entries that exactly match what the runtime parser would load.
Test coverage
- 27 new focused tests added. Total 62, all passing.
- New file
tests/host-keywords.test.jscovers punycode / IDN, multilingual positive coverage (CN / JP / KR / Cyrillic / AR / TH), strict whole-label vs substring matching, and false-positive guards. tests/utilities.test.jsextended forisLikelyDomain()punycode cases.tests/parse-hosts.test.jsextended for punycode host survival and malformed IDN-like garbage rejection.
No regressions
- All existing English-domain blocking still works.
dnsFilterEnabledremains an optional fallback, not required.
Context-Aware Keyword Detection
- No longer blocks recovery/support articles about overcoming addiction
- Distinguishes "how to quit porn" from "watch free porn" using contextual analysis
- Safe context keywords: help, recovery, quit, overcome, support, therapy, education, etc.
- Risk context keywords: free, watch, stream, download, live, cam, etc.
Enhanced Domain Blocking
- Now uses the massive Anti-Porn HOSTS File (100k+ domains)
- Auto-updates weekly from GitHub (cached locally for 7 days)
- Chunked storage (5000 domains per chunk) to avoid browser limits
- Fast Set-based lookups instead of slow regex matching
Optimized Architecture
- Background worker maintains canonical blocklist
- Content script requests snapshot on demand
- Instant host-level checks at
document_startprevent page flash - Caching system with automatic invalidation
Smart Caching
- Pattern cache for compiled regexes
- URL check cache with version tracking
- Keyword check cache for hostname analysis
- Max 1000 entries per cache to prevent memory bloat
Buy Me a Coffee Button
- Added to popup for easy support (https://buymeacoffee.com/monolab.co)
- Styled with yellow/gold theme
- Opens in new tab
Verbose Logging Toggle
- Debug logging now disabled by default to avoid console noise
- New "Enable verbose logging" switch in
options.html - Toggle persists to
pblocker_settings.debugMode - Content scripts watch for changes and enable logs on demand
New Message Types
get_blocklist_snapshot: Content script requests current blocklistshould_block_url: Check if a URL should be blockedrefresh_remote_blocklist: Force refresh from GitHub
Storage Keys
pblocker_blocklist_meta_v2: Metadata (version, timestamp, chunk count)pblocker_blocklist_chunk_v2_0,_1, etc.: Domain chunks
- ✅ Visit a recovery article (e.g., "how to overcome porn addiction") - should NOT block
- ✅ Visit an actual adult site - should block immediately
- ✅ Check browser console for "Blocklist snapshot loaded X domains"
- ✅ Test Buy Me a Coffee button opens correct URL
- ✅ Verify context-aware filtering in search results
- Old
blocklist.jsonstill used as fallback if remote fetch fails - Existing settings and whitelist preserved
- No user action required - upgrade happens automatically
- First load may take a few seconds to download remote blocklist
background.js: Added remote blocklist fetching, chunked storage, context-aware logic
content.js: Updated to use blocklist snapshot, improved keyword detection
popup.html: Added Buy Me a Coffee button with styling
- Blocklist size: ~100,000+ domains (vs ~30 before)
- Lookup speed: O(1) Set lookup vs O(n) regex matching
- Memory usage: Chunked storage prevents single large object
- Update frequency: Weekly automatic refresh
- Cache TTL: 7 days
Open browser console and run:
// Check current stats
window.PBlocker.getStats()
// Test keyword detection
window.PBlocker.testKeywords("how to overcome porn addiction") // Should return false
window.PBlocker.testKeywords("watch free porn videos") // Should return true
// Test URL blocking
window.PBlocker.testURL("https://example.com")If you encounter issues:
- Check browser console for errors
- Verify blocklist loaded: Look for "Blocklist snapshot loaded" message
- Try refreshing the page
- Clear extension storage and reload
Last Updated: 2025-10-30 Version: 1.2.0 (Chrome)