feat: add cross-browser X GeoBlock extension

This commit is contained in:
Darío Sevilla committed 2026-10-15 07:22:51 +00:00
commit 0944faab3e
26 files changed
+803

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
# Architecture
## Request flow
1. The content script observes X's timeline and extracts an author from each canonical `/user/status/id` link.
2. The service worker checks the local cache and coalesces concurrent lookups for the same username.
3. On a cache miss, the background process requests `https://x.com/<user>/about` with the browser's existing X session.
4. Chromium passes the HTML to an offscreen document; Firefox parses it in its background page. The parser locates the location-pin row for the account country and also inspects embedded user data for the `following` relationship.
5. The worker caches the result and compares the country with the configured blacklist.
6. The content script hides the post only when the country matches and the account is not followed.
Failed or ambiguous lookups fail open: the post remains visible. The cache is limited to 2,000 entries and pruned to the 1,500 most recently checked entries when the limit is exceeded.
## Browser components
- `background.js`: networking, throttling, cache, and decisions.
- `content.js`: timeline observation and post visibility.
- `offscreen/`: isolated HTML parsing with `DOMParser`.
- `lib/parser.js`: DOM and embedded-data extraction.
- `lib/config.js`: defaults and country normalization.
- `options/` and `popup/`: user controls.
## Compatibility
The Chromium package requires Chrome 109 or newer. Firefox 109 or newer uses a browser-specific background-page manifest and does not require the Chromium offscreen-document API.
+7
View File
@@ -0,0 +1,7 @@
# Privacy
X GeoBlock does not collect analytics, transmit browsing data to third parties, or operate a remote server.
The extension reads public account About pages from `x.com` using the X session already present in your browser. It stores usernames, detected countries, following status, and lookup timestamps in local extension storage. Settings use synchronized extension storage when browser sync is enabled. You can clear the lookup cache at any time from the settings page or remove all extension data by uninstalling the extension.
The extension reads post author links in X timelines only to decide whether to display those posts. It does not read or store post text.
+15
View File
@@ -0,0 +1,15 @@
# Releases
Every non-release commit that reaches `main` starts `.github/workflows/release.yml`. The workflow updates the version in `manifest.json` and `package.json`, commits that change to `main`, runs the checks, builds both browser packages, creates a version tag, and publishes a GitHub release containing:
- `x-geoblock-chrome-vX.Y.Z.zip`
- `x-geoblock-firefox-vX.Y.Z.xpi`
The Firefox XPI is unsigned. It can be used for temporary installation and as the input for Mozilla Add-ons signing.
## Version rules
- A pull request whose head branch is exactly `development` and whose base is `main` increments the minor component and resets patch to zero: `1.4.7` becomes `1.5.0`.
- Every other commit reaching `main`, including direct commits and merges from `hotfix/*`, increments the patch component: `1.4.7` becomes `1.4.8`.
The automated version commit contains `[skip release]`, preventing a second workflow release. The repository must allow GitHub Actions to push commits and tags to `main`; if branch protection is enabled, grant the Actions bot an appropriate bypass or use an equivalent ruleset exception.