A Chrome extension that allows users to add, modify, and delete HTTP request headers for specific websites with profile management.
- Profile Management: Create multiple profiles, each targeting specific websites
- Header Modification: Add, modify, or delete HTTP headers
- Toggle Profiles: Enable/disable profiles individually
- URL Pattern Matching: Flexible URL pattern matching for targeting specific sites
- Privacy-Focused: Uses Manifest V3 and declarativeNetRequest API
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right corner
- Click "Load unpacked"
- Select the
modify-headerfolder - The extension icon should appear in your toolbar
- Click the extension icon in the toolbar
- Click "New Profile"
- Enter a profile name (e.g., "Development API")
- Enter a URL pattern:
example.com- matches any URL containing example.com*.example.com- matches all subdomains of example.comhttps://api.example.com/*- matches all URLs starting with this
- Add headers:
- Add: Add a new header to requests
- Modify: Change an existing header value
- Delete: Remove a header from requests
- Click "Save"
- Enable/Disable: Use the toggle switch on each profile
- Edit: Click the "Edit" button to modify a profile
- Delete: Click the "Delete" button to remove a profile
Profile: Dev API Headers
URL Pattern: localhost:3000
Headers:
- Add:
X-Debug-Mode=true - Add:
Authorization=Bearer dev-token-123
Profile: Custom API Headers
URL Pattern: https://api.example.com/*
Headers:
- Add:
X-API-Key=your-api-key - Modify:
User-Agent=CustomBot/1.0 - Delete:
Referer
Profile: CORS Headers
URL Pattern: example.com
Headers:
- Add:
Origin=https://example.com - Add:
Access-Control-Request-Method=POST
/modify-header
├── manifest.json # Extension configuration
├── background.js # Service worker for managing rules
├── popup.html # Extension popup UI
├── popup.css # Popup styling
├── popup.js # Popup logic and interactions
├── README.md # This file
└── icons/
├── icon16.png # 16x16 icon
├── icon48.png # 48x48 icon
└── icon128.png # 128x128 icon
declarativeNetRequest: For modifying HTTP headersdeclarativeNetRequestWithHostAccess: For host-specific modificationsstorage: For saving user profiles<all_urls>: For applying rules to any website
Profiles are stored in chrome.storage.local with the following structure:
{
profiles: [
{
id: "unique-id",
name: "Profile Name",
urlPattern: "example.com",
enabled: true,
headers: [
{
action: "add", // "add", "modify", or "delete"
name: "X-Custom-Header",
value: "custom-value",
},
],
createdAt: 1234567890,
},
];
}The extension converts user-friendly URL patterns to declarativeNetRequest URL filters:
example.com→*://*.example.com/*https://api.example.com→https://api.example.com**.example.com→ Used as-is- Wildcards (
*) are supported
- Maximum of 5000 dynamic rules (Chrome limitation)
- Header modifications apply to the main document and all resource types
- Some headers cannot be modified due to browser security restrictions (e.g.,
Host,Cookiein some contexts)
- Check if the profile is enabled (toggle switch should be green)
- Verify the URL pattern matches the target website
- Open Chrome DevTools > Network tab to inspect headers
- Check the extension's service worker logs:
- Go to
chrome://extensions/ - Click "service worker" under
Modify Headers - Look for errors in the console
- Go to
- Some headers are protected by the browser and cannot be modified
- Ensure the URL pattern correctly matches the target URL
- Try using a more specific URL pattern
- Disable other extensions that might interfere with headers
- Changes are applied immediately when you save a profile
- If issues persist, try:
- Disable and re-enable the profile
- Reload the extension from
chrome://extensions/ - Restart Chrome
- Make changes to the source files
- Go to
chrome://extensions/ - Click the reload icon for
Modify Headers - Test your changes
- Background Script: Click "service worker" in
chrome://extensions/ - Popup: Right-click the popup and select "Inspect"
- Storage: Use Chrome DevTools > Application > Storage > Local Storage
This extension:
- Does NOT collect any data
- Does NOT send data to external servers
- Stores all data locally in your browser
- Only modifies headers for websites matching your URL patterns
This project is provided as-is for educational and development purposes.
For issues or questions:
- Check the Troubleshooting section above
- Review Chrome's declarativeNetRequest API documentation
- Inspect the browser console for error messages
- Profile management with enable/disable
- Import / Export / Clone Profiles
- Add, modify, and delete headers
- URL pattern matching
- Manifest V3 compatibility