A powerful Chrome extension that allows you to intercept, modify, and delay network requests in real-time.
- URL Pattern Matching: Use regular expressions to target specific requests
- Response Modification: Change response body, status codes, and headers
- Request Delay: Add artificial delays to simulate slow network conditions
- Rule Management: Enable/disable rules individually
- Easy-to-Use Interface: Simple popup UI for managing intercept rules
- Clone this repository or download the source code
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right corner
- Click "Load unpacked" and select the extension directory
- The extension icon should appear in your Chrome toolbar
- Click the extension icon in the Chrome toolbar
- Toggle the switch to "Enabled" to start intercepting requests
- Click "Add Rule" to create your first intercept rule
-
URL Pattern: Enter a regular expression to match URLs
- Example:
.*api\.example\.com.*matches any URL containing "api.example.com" - Example:
.*\.json$matches all requests ending with ".json"
- Example:
-
Status Code: Set the HTTP status code (200, 404, 500, etc.)
-
Delay (ms): Add a delay in milliseconds before the response is returned
-
Response Body: Provide custom response data
- Can be JSON:
{"message": "Custom response"} - Or plain text:
Hello World
- Can be JSON:
-
Custom Headers: Add or override response headers (JSON format)
{ "Content-Type": "application/json", "X-Custom-Header": "value" }
- Enable/Disable: Click the checkmark button to toggle a rule on/off
- Edit: Modify existing rules by clicking the "Edit" button
- Delete: Remove rules with the "Delete" button
URL Pattern: .*api\.example\.com/users.*
Status Code: 200
Response Body:
{
"users": [
{"id": 1, "name": "John Doe"},
{"id": 2, "name": "Jane Smith"}
]
}URL Pattern: .*\.jpg$
Delay: 3000
Status Code: 200
(Leave response body empty to use original)
URL Pattern: .*api\.example\.com/error.*
Status Code: 500
Response Body:
{"error": "Internal Server Error"}This extension uses Chrome's Debugger API to intercept network requests at a low level:
- When enabled, the extension attaches the Chrome Debugger to the active tab
- The
Fetchdomain is enabled to intercept all network requests - Each request is checked against your defined rules
- Matching requests are fulfilled with your custom response
- Non-matching requests continue normally
- debugger: Required to intercept and modify network requests
- storage: To save your intercept rules
- tabs: To access information about browser tabs
- activeTab: To interact with the currently active tab
- host_permissions: To intercept requests from all URLs
- Only works on tabs where the debugger can be attached
- Cannot intercept requests from Chrome's built-in pages (chrome://)
- Only one debugger can be attached to a tab at a time
- When enabled, the tab will show "Debugger attached" notification
network-intercept/
├── manifest.json # Extension configuration
├── background.js # Service worker for request interception
├── popup.html # Popup UI structure
├── popup.css # Popup styles
├── popup.js # Popup logic
├── icons/ # Extension icons
└── README.md # Documentation
- Chrome Extension Manifest V3
- Chrome Debugger API
- Fetch Domain API
- Vanilla JavaScript (no frameworks)
Extension not intercepting requests?
- Make sure the toggle is enabled
- Check that your URL pattern is correct (test with regex101.com)
- Ensure the rule is enabled (checkmark should be visible)
"Debugger attached" notification won't go away?
- This is expected behavior when the extension is enabled
- Disable the extension to remove the notification
Changes not taking effect?
- Try reloading the page after adding/modifying rules
- Check the browser console for error messages
- This extension runs locally in your browser
- No data is sent to external servers
- Rules are stored locally using Chrome's storage API
- Only intercepts requests when explicitly enabled
MIT License - Feel free to modify and distribute as needed.
Contributions are welcome! Please feel free to submit issues and pull requests.
For issues, questions, or suggestions, please open an issue on the GitHub repository.

