Skip to content

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

JS Disable Control ✨

中文版

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.

🚀 Features

  • Regex Filtering: Define complex URL patterns to target specific sites or resource paths.
  • CSP Injection: Uses declarativeNetRequest to set script-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.

🛠 Installation

  1. Clone or download this repository.
  2. Open Chrome and navigate to chrome://extensions/.
  3. Enable "Developer mode" in the top right corner.
  4. Click "Load unpacked" and select the folder containing the extension files.

📖 How to Use

  1. Click the extension icon in your toolbar to open the Options page.
  2. 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)
  3. Click "Save And Apply".
  4. Refresh the target page to see the changes take effect.

📂 File Structure

  • 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).

🛡 Permissions

  • 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>).

About

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.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages