Open-source browser extension for blocking adult websites and reducing unsafe content exposure across browsing, search, and selected social surfaces.
Project status:
- Published as Chrome and Firefox extension
- Already used by thousands of users
- Source-first repo with Chrome and Firefox build scripts
Current version: 1.6.1
- Chrome Web Store: https://chromewebstore.google.com/detail/blocknsfw-%E2%80%93-porn-adult-co/fiecjgpoilkhmoieaboolkfmgbnhlhop
- Firefox Add-ons: https://addons.mozilla.org/en-US/firefox/addon/blocknsfw-porn-adult-content/
- Microsoft Edge Add-ons: https://microsoftedge.microsoft.com/addons/detail/blocknsfw-%E2%80%93-porn-adult-/imccbmfplknoadpaoopicfdpnnimgdab
- License: MIT
- CI status: https://github.com/codepurse/BlockNSFW/actions/workflows/build.yml
(the
build.ymlworkflow runs the focused test suite andweb-ext linton every push)
BlockNSFW combines several protection layers:
- Domain blocking with local fallback rules plus cached remote blocklist updates. IDN / punycode hostnames (e.g.
xn--porn-tqa.net) are retained at runtime, not silently dropped. - Hostname smart filter that scans both the ASCII / punycode form and the decoded Unicode form of a hostname, with multilingual adult-hostword coverage (Chinese, Korean, Russian, Arabic, Thai, plus transliterated Latin).
- Page and visible-content filtering through a Manifest V3 content script
- Search SafeSearch enforcement on Google, Bing, DuckDuckGo, Yahoo, Brave, Ecosia, Qwant, AOL Search, and Presearch
- Optional DNS-based blocking through Cloudflare for Families
- Reddit NSFW subreddit checks for Reddit-specific filtering paths
- Optional Facebook Reels and Instagram Reels blocking toggles
- Local stats, streak tracking, whitelist management, and audit views
- Manual community reports for blocked / missed sites
Main files:
manifest.json- Chrome/Chromium MV3 manifestmanifest.firefox.json- Firefox MV3 manifestbackground.js- blocklist loading, DNS checks, dynamic rules, stats, audit storagecontent.js- page filtering, SafeSearch enforcement, Reddit checks, DOM scanningshared/hostname.js- browser-safe punycode / IDN helpers (RFC 3492)shared/host-keywords.js- shared smart-blocking keyword list and strict host matcherpopup.html/popup.js- quick toggle, stats, shortcutsoptions.html/options.js- full settings UI, whitelist tools, audit/stats accessblocked.html/blocked.js- blocked pageaudit.html/audit.js- audit viewstats.html/stats.js- statistics viewdata/HOSTS.txt- curated source blocklist (self-hosted indata/under MIT)data/WHITELIST.txt- curated global whitelistdata/SOURCE_NOTES.txt- data-file provenance, curation policy, missed-site flowblocklist.json- bundled fallback blocklist (regenerated fromdata/HOSTS.txt)build-chrome.ps1/build-firefox.ps1- release bundle scripts
Tech stack:
- Manifest V3
- Vanilla JavaScript / HTML
- No Node build step required
Additional maintainer docs:
ARCHITECTURE.mdRELEASE_CHECKLIST.mdTHIRD_PARTY_NOTICES.md
Most filtering decisions happen locally in the browser, but this project is not fully offline.
Network requests may occur for these features:
- Remote blocklist and whitelist updates from GitHub-hosted text files
- Optional DNS filtering through
family.cloudflare-dns.com - Reddit subreddit NSFW checks through Reddit endpoints
- Optional manual community reports through Appwrite-hosted backend
Privacy details live in PRIVACY_POLICY.md. Public docs should stay aligned with real code behavior.
Supported:
- Chrome 88+
- Firefox 109+
- Chromium-based browsers that support MV3 and required permissions
More detail: BROWSER_COMPATIBILITY.md
- Open
chrome://extensions/or equivalent browser extensions page. - Enable Developer Mode.
- Click Load unpacked.
- Select repo root containing
manifest.json.
- Open
about:debugging#/runtime/this-firefox. - Click Load Temporary Add-on...
- Select
dist\firefox\manifest.jsonafter running Firefox build script.
Chrome:
powershell -ExecutionPolicy Bypass -File .\build-chrome.ps1
powershell -ExecutionPolicy Bypass -File .\build-chrome.ps1 -ZipFirefox:
powershell -ExecutionPolicy Bypass -File .\build-firefox.ps1
powershell -ExecutionPolicy Bypass -File .\build-firefox.ps1 -ZipBuild output:
dist\chrome\dist\firefox\
Before release:
- Load Chrome build and Firefox build.
- Confirm popup opens and main toggle works.
- Confirm options page opens and settings persist.
- Confirm blocked page, audit page, and stats page open correctly.
- Confirm SafeSearch rules apply on at least one supported engine.
- Confirm whitelist add/remove flow works.
- Confirm no obvious console errors after fresh install.
See .github/CONTRIBUTING.md.
If you want to report:
- blocking misses or false positives
- browser-specific regressions
- privacy/security concerns
- UX issues in popup/options flows
open an issue with steps, URLs/domains involved, browser version, and feature flags used.
Near-term priorities:
- tighten open-source launch polish
- add focused regression coverage for high-risk blocking logic
- improve release automation and browser-specific validation
MIT. See LICENSE.
- Add store listing links once public repo announcement is ready
- Keep generated
dist/output out of version control - Keep docs consistent with actual network behavior and permissions
- Remote blocklist source is self-hosted in
data/under MIT (seeTHIRD_PARTY_NOTICES.md);background.jsREMOTE_BLOCKLIST_URLandREMOTE_WHITELIST_URLpoint at the publiccodepurse/BlockNSFWraw URLs - Appwrite manual-report backend is maintained out-of-tree; its
public-launch status and the data it receives are documented in
THIRD_PARTY_NOTICES.mdandPRIVACY_POLICY.md