A lightweight Chrome Extension (Manifest V3) that gives you granular control over JavaScript execution using Regex-based URL filtering. By injecting a Content-Security-Policy header, this extension can effectively disable script execution on specific pages or domains.
- Regex Filtering: Define complex URL patterns to target specific sites or resource paths.
- CSP Injection: Uses
declarativeNetRequestto setscript-src 'none', ensuring high-performance blocking. - Persistent Storage: Your rules are saved locally and persist across browser sessions.
- Clean UI: A modern, responsive options page for easy rule management.
- Clone or download this repository.
- Open Chrome and navigate to
chrome://extensions/. - Enable "Developer mode" in the top right corner.
- Click "Load unpacked" and select the folder containing the extension files.
- Click the extension icon in your toolbar to open the Options page.
- Enter your Regex rules in the text area (one rule per line).
- Example:
.*example\.com/.*(Disables JS for the entire domain) - Example:
.*blog/post-.*(Disables JS for specific paths)
- Example:
- Click "Save And Apply".
- Refresh the target page to see the changes take effect.
manifest.json: Extension configuration and permissions.background.js: Service worker to handle extension actions.options.html/options.js: The user interface for managing Regex rules.icon.png: Extension identifier (requires a 128x128 image).
declarativeNetRequest: Used to modify network headers dynamically.storage: Used to save your custom Regex rules.host_permissions: Required to apply rules across all websites (<all_urls>).