xBlockOrigin supports both Chrome (Manifest V3) and Firefox (Manifest V2). This guide covers how to build the extension for each browser.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/chefnaphtha/xBlockOrigin/llms.txt
Use this file to discover all available pages before exploring further.
Build commands
The project provides several build scripts for different scenarios:Build process
The build process consists of two main steps for each browser:Bundle JavaScript
Bun compiles TypeScript source files into browser-compatible JavaScript:
src/Content/index.ts→content.js(Content script)src/Background/index.ts→background.js(Background service worker)src/Popup/index.tsx→popup.js(Popup UI)
--target browser flag for browser compatibility.Build output
After building, you’ll find the compiled extensions in thedist/ directory:
The only difference between Chrome and Firefox builds is the manifest file. Chrome uses Manifest V3 with a service worker, while Firefox uses Manifest V2 with a persistent background page.
Browser-specific builds
Chrome/Edge (Manifest V3)
The Chrome build uses Manifest V3, which includes:- Service worker instead of persistent background page
- Updated permissions model
- Better performance and security
build:chrome:js- Bundles TypeScript filesbuild:chrome:assets- Copies manifest.v3.json and static assets
Firefox (Manifest V2)
The Firefox build uses Manifest V2, which includes:- Persistent background page (required for Firefox compatibility)
- Traditional permissions model
build:firefox:js- Bundles TypeScript filesbuild:firefox:assets- Copies manifest.v2.json and static assets
Development workflow
For active development, follow this workflow:Production builds
For production releases, the CI/CD pipeline automatically:- Runs type checking and linting
- Builds both browser versions
- Injects version numbers into manifests
- Creates ZIP files for distribution
- Creates GitLab releases with version tags
Troubleshooting
Build fails with type errors
Run type checking to see detailed errors:Extension doesn’t load in browser
Check that:- The build completed without errors
- The
dist/chrome/ordist/firefox/directory exists and contains all files - The manifest.json file is valid JSON
Changes not appearing
Make sure you:- Rebuilt the extension after making changes
- Reloaded the extension in the browser
- Refreshed the X.com page you’re testing on