This repository contains a Firefox extension that disables image loading on selected websites and can sync the blocked-site list through Firefox Sync.
Popup preview:
Settings preview:
- Blocks network image requests on the sites you choose.
- Hides image elements on matching pages to avoid broken placeholders.
- Lets you toggle the current site from the toolbar popup.
- Provides an options page to add or remove blocked hosts manually.
- Saves blocked hosts to Firefox Sync when available so the list can follow your Firefox profile to other desktop devices.
- Injects the page-hiding script only on matching sites instead of every page.
- Lets you export, import, and bulk-refresh affected tabs from the settings page.
manifest.json: Firefox extension manifest.background.js: Request blocking and rule management.content/hide-images.js: Hides image elements when injected on matching pages.icons/: Toolbar and add-on manager icon assets.popup/: Toolbar popup UI.options/: Full settings page.scripts/build-xpi.ps1: Packages the extension as an.xpifile.
- Open
about:debugging#/runtime/this-firefox. - Click
Load Temporary Add-on.... - Choose the
manifest.jsonfile from this folder. - Pin the extension if you want quick access to the popup.
Temporary add-ons are removed when Firefox fully exits, so this method is only for development and quick testing.
From this project root, run:
powershell -ExecutionPolicy Bypass -File .\scripts\build-xpi.ps1The packaged file will be created in dist/ with a name like:
site-image-blocker-example.com-1.0.0.xpi
This repository includes a GitHub Actions workflow that builds the extension
package whenever you push a tag that starts with v.
Example:
git tag v1.0.0
git push origin v1.0.0That workflow will:
- build the
.xpipackage - upload it as a workflow artifact
Do not attach the unsigned workflow artifact directly to a public GitHub
Release. Stable Firefox installs require a Mozilla-signed package. If you
publish a release for users, upload the signed .xpi you receive from AMO.
To keep the extension installed across browser restarts, you need a normal installed add-on instead of a temporary one.
- Create an account on Mozilla Add-on Developer Hub.
- Upload the generated
.xpifor signing. - Install the signed package in Firefox.
This is the standard route for stable Firefox builds.
For this repository, the easiest signing route is an unlisted submission.
See AMO_SUBMISSION.md for a ready-to-use checklist and suggested metadata.
Firefox Developer Edition and Nightly are better for repeated extension testing. They are commonly used during development when you do not want to rely on temporary loading every session.
- The popup toggles the current host on or off.
- The options page edits a list of blocked hosts stored in
browser.storage.syncwhen Firefox Sync is available, and mirrors it locally for fast page checks. - The settings page can export the rule list, import it again later, and reload all currently open tabs that match the saved rules.
- If sync writes fail later, the extension automatically falls back to local storage instead of breaking rule updates.
- The background script cancels requests of type
imageandimagesetwhen the originating page matches one of your saved hosts. - The background script injects the content script only on matching
httpandhttpspages so unrelated pages do not pay for the extra storage read. - The content script hides image tags and inline background images on matching pages for a cleaner result.
- Rules are host based. Saving
example.comalso covers subdomains such asimg.example.com. - Tabs usually need a reload before the request blocking takes effect.
- Existing locally saved rules are migrated into sync storage the first time the
extension can use
browser.storage.sync. - If you install by temporary loading from
about:debugging, Firefox removes the add-on after the browser restarts.
This project is released under the Unlicense. See LICENSE.