A Chrome Extension (Manifest V3) that prevents WebP and AVIF formats, ensuring images load and save in their original formats (GIF, PNG, JPG).
- Uses Declarative Net Request to modify
Acceptheaders, removingimage/webpandimage/avif - Forces servers to fall back to original formats (GIF, PNG, JPG)
- Optional URL parameter rewriting to strip WebP-forcing parameters
- Content script runs at
document_startto intercept image loading - Removes or demotes
<source type="image/webp">in<picture>elements - Selects non-WebP candidates from
srcsetattributes - Works with lazy loading via MutationObserver
- Right-click context menu: "Save image as original format"
- Re-fetches images with modified headers to get original format
- Automatically detects correct file extension from Content-Type
- Handles
<picture>,srcset, and regular images
- Enable/disable WebP blocking globally
- Manage per-site allowlist for sites that require WebP
- Toggle URL parameter rewriting
- Beautiful, modern options page
-
Open Chrome and navigate to
chrome://extensions/ -
Enable "Developer mode" (toggle in top-right corner)
-
Click "Load unpacked"
-
Select the extension directory (folder containing
manifest.json) -
Verify Installation:
- The extension should appear in your extensions list
- Click "Options" to configure settings if needed
For detailed installation instructions, see INSTALLATION_GUIDE.md.
Once installed, the extension automatically:
- Blocks WebP/AVIF requests at the network level
- Modifies DOM to prefer original formats
- Allows right-click saving of images in original format
Click the extension icon or go to Options to:
-
Enable/Disable WebP Blocking
- Toggle the main functionality on/off
- Useful for troubleshooting or temporary disable
-
URL Rewriting
- Removes query parameters that force WebP (e.g.,
fm=webp,format=webp) - Toggle on/off based on your needs
- Removes query parameters that force WebP (e.g.,
-
Site Allowlist
- Default allowlist: Reddit (reddit.com and related domains) is pre-configured since it only serves WebP
- Add additional domains where WebP should NOT be blocked
- Useful for sites that only serve images in WebP format
- Example:
example.com,cdn.example.com - You can remove default sites if needed (though they may not function properly)
Method 1: Context Menu
- Right-click any image
- Select "Save image as original format"
- Image is re-fetched with original format headers
- Downloads with correct file extension
Method 2: Regular Save
- Since WebP is blocked at network level, regular "Save image as..." should also work
Test the extension on these sites known to serve WebP:
- Google Images: https://images.google.com (should show original formats)
- Reddit: https://www.reddit.com (on allowlist by default, will show WebP)
- Twitter: https://twitter.com (should show original formats)
- Imgur: https://imgur.com (should show original formats)
- Wikipedia: https://www.wikipedia.org (should show original formats)
Note: Reddit is on the default allowlist because it only serves WebP. To test WebP blocking on Reddit, you would need to remove it from the allowlist (though images may not load).
-
Check Network Tab:
- Open DevTools (F12) → Network tab
- Filter by "Img"
- Load a page with images
- Verify images are loading as GIF/PNG/JPG instead of WebP
-
Check Accept Header:
- In Network tab, click an image request
- Check Headers → Request Headers
- Verify Accept header does NOT include
image/webporimage/avif
-
Test GIF Animation:
- Find an animated GIF
- Verify it displays correctly (not as static WebP)
- Right-click → "Save image as original format"
- Verify saved file is
.gifand animates
-
Check Console:
- Look for extension logs
- No errors should appear
chrome-nowebp/
├── manifest.json # Extension manifest (MV3)
├── background.js # Service worker (DNR, context menu)
├── content.js # Content script (DOM manipulation)
├── options.html # Options page UI
├── options.js # Options page logic
├── icons/ # Extension icons
│ ├── icon16.png # 16x16 toolbar icon
│ ├── icon48.png # 48x48 management icon
│ ├── icon128.png # 128x128 store icon
│ └── icon.svg # SVG source
├── README.md # This file
└── INSTALLATION_GUIDE.md # Installation instructions
- declarativeNetRequest: Modify headers and URLs at network level
- Service Worker: Background script with persistence
- Content Scripts: Run at
document_startfor early interception - Chrome Storage API: Sync settings across devices
The extension creates dynamic rules to:
- Modify Accept header: Remove WebP/AVIF mime types from image requests
- Redirect URLs: Strip WebP-forcing parameters (optional)
- Initial Processing: Process existing images on page load
- MutationObserver: Watch for dynamically added images
- Picture Elements: Remove WebP/AVIF sources
- Srcset Handling: Select best non-WebP candidate based on DPR
- User right-clicks image
- Extension fetches image URL with modified Accept header
- Inspects Content-Type to determine format
- Downloads with correct file extension
- Check if extension is enabled (Options page)
- Check if site is on the allowlist - Reddit and related domains are on the default allowlist
- Check browser console for errors
- Some CDNs may only serve WebP with no fallback - add these sites to allowlist if they break
- Ensure Downloads permission is granted
- Check popup blocker settings
- Some sites may block cross-origin fetches
- Disable URL rewriting if causing problems
- Add problematic sites to allowlist
- Check console for excessive logs
- CDN Limitations: Some CDNs only serve WebP - no fallback available
- Cross-Origin Restrictions: Some images can't be re-fetched due to CORS
- Srcset Complexity: Complex srcset with mixed formats may not always select optimally
- Background Images: CSS background images are not currently handled
Feel free to submit issues, fork the repository, and create pull requests for any improvements.
This project is provided as-is for educational and practical use.
- Network-level WebP/AVIF blocking via DNR
- DOM fallback for picture and srcset elements
- Context menu for saving images in original format
- Options page with allowlist management
- URL parameter rewriting (optional)
- Default allowlist for WebP-only sites (Reddit and related domains)