Replace any image on any webpage with your own — from a URL or a local file. Rules are saved per page and applied automatically on every visit. Works on both desktop and mobile Firefox.
- Click to replace — right-click any image on desktop, or long-press on mobile
- Two replacement sources — paste an external URL, or upload a file directly from your device
- Per-page rules — replacements are scoped to the exact page URL, so they don't bleed across sites
- Persistent storage — rules survive page reloads and browser restarts
- Dynamic images — works with images loaded after the page (infinite scroll, JS-rendered content)
- Popup manager — view, preview, and delete all your rules from the extension popup
- Mobile-friendly — long-press gesture triggers the panel on Firefox for Android
Right-click any image → select "🔄 Replace this image" from the context menu → choose a replacement URL or upload a local file → click Apply.
Long-press any image (hold for ~0.5s) → the replacement panel slides up from the bottom → choose URL or file → tap Apply.
The replacement is applied immediately and saved. Next time you visit the same page, the image is swapped automatically.
- Clone or download this repository
- Open Firefox and go to
about:debugging - Click This Firefox → Load Temporary Add-on
- Select
manifest.jsonfrom the project folder - The extension is active until you close Firefox
- In Firefox Developer Edition or Nightly, open
about:config - Set
xpinstall.signatures.requiredtofalse - Download the
.xpifile from Releases - Drag and drop the
.xpiinto Firefox, or open it via File → Open File - The extension installs permanently
- Register at addons.mozilla.org
- Go to Developer Hub → Submit a New Add-on
- Choose "Only for myself (unlisted)" — no moderation, instant signing
- Upload the
.xpiand download the signed version - Install the signed
.xpi— works in any Firefox release, including mobile
Firefox for Android supports extensions via custom collections:
- Sign in to addons.mozilla.org and add this extension to a collection
- In Firefox for Android: Settings → About Firefox → tap the logo 5 times to enable developer mode
- Go to Custom Add-on collection and enter your AMO user ID and collection name
- The extension will appear in your add-ons list
An .xpi file is just a ZIP archive with a different extension. To build one:
Linux / macOS:
cd image-replacer/
zip -r ../image-replacer.xpi manifest.json background.js content.js content.css popup.html popup.js icons/Windows (PowerShell):
Compress-Archive -Path ".\image-replacer\*" -DestinationPath ".\image-replacer.zip"
Rename-Item ".\image-replacer.zip" "image-replacer.xpi"
⚠️ Make suremanifest.jsonends up at the root of the archive, not inside a subfolder — otherwise Firefox will report the file as corrupted.
image-replacer/
├── manifest.json # Extension manifest (MV2)
├── background.js # Context menu registration & storage logic
├── content.js # Page-level logic: rule application, panel, gestures
├── content.css # Styles for the replacement panel & toast
├── popup.html # Extension popup UI
├── popup.js # Popup logic: rule listing & management
└── icons/
├── icon48.png
└── icon96.png
| Permission | Why it's needed |
|---|---|
activeTab |
Read the current page URL to scope rules correctly |
storage |
Persist replacement rules across sessions |
contextMenus |
Add "Replace this image" to the right-click menu (desktop) |
<all_urls> |
Inject the content script to apply rules on any page |
No data is sent to any server. Everything is stored locally in your browser.
- Built with Manifest V2 for maximum compatibility, including Firefox for Android (Fenix)
- Uses
browser.storage.local— rules are stored in your browser profile, not synced - Local file replacements are stored as base64 data URLs — no external hosting needed
- A
MutationObserverwatches for dynamically injected images and applies rules to them too - The long-press threshold is 500ms with movement cancellation, to avoid conflicts with native scroll
Issues and pull requests are welcome! Some ideas for future improvements:
- Export / import rules as JSON
- Wildcard URL matching (e.g. apply a rule to all pages on a domain)
- Rule toggle (enable/disable without deleting)
- Cloud sync via
browser.storage.sync - Support for
background-imageCSS replacement via the UI
MIT License — do whatever you want with it. © 2026 f3rufus