Add root CLAUDE.md, docs/architecture.md, LESSONS.md, .env.example, VERSION, .claude/settings.json hooks (syntax/JSON checks since no linter/tests exist yet), and CI/version-bump GitHub workflows. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1.8 KiB
1.8 KiB
Architecture
Firefox Manifest V2 WebExtension with no build step; all files are loaded as-is.
Layout
manifest.json— extension manifest (background scripts, permissions, popup).background.js/sites.js— background scripts.sites.jsholds the per-site paywall bypass rules (cookie handling, regex blocks, DOM tweaks);background.jsimplements the request interception and rule engine that applies them.contentScript.js,contentScript_once.js,contentScript_once_var.js— content scripts injected into pages to apply DOM-level bypass logic.options/— options UI and popup (options.html,popup.html, their JS/CSS, plusclearCookies.js,version.js, exclusion/custom-rule sub-pages).custom/— local override layer:custom/sites_custom.json— per-site rule overrides/additions, merged withsites.jsat runtime.custom/manifest.json— an alternate manifest (e.g. "limited permissions" variant), not the one actually used to load the extension by default.
sites_updated.json,updates.json— metadata used by the extension's self-update check against the upstream project.lib/— small vendored libraries (purify.min.js,empty.js).changelog.txt,README.md,README.html— upstream-maintained docs; replaced wholesale on each upstream sync, don't hand-edit beyond local notes.
Data flow (high level)
background.jsreads the merged site rules (sites.js+custom/sites_custom.json).- On matching requests/pages it applies cookie/header rules via the
webRequestAPI. - Content scripts apply DOM-level rules (removing overlays, revealing hidden content, injecting archive links, etc.) as instructed by the matched site rule.
- The options/popup UI lets the user toggle sites, add custom rules, and view status.