webext-dynamic-content-scripts icon indicating copy to clipboard operation
webext-dynamic-content-scripts copied to clipboard

WebExtension module: Automatically registers your content_scripts on domains added via permission.request

webext-dynamic-content-scripts npm version

WebExtension module: Automatically registers your content_scripts on domains added via permissions.request

  • Browsers: Chrome, Firefox, and Safari
  • Manifest: v2 (v3 coming soon)

This module will automatically register your content_scripts from manifest.json into new domains granted via permissions.request(), or via webext-domain-permission-toggle.

The main use case is ship your extension with a minimal set of hosts and then allow the user to enable it on any domain; this way you don't need to use a broad <all_urls> permission.

Guides

How to let your users enable your extension on any domain.

Install

You can download the standalone bundle and include it in your manifest.json. Or use npm:

npm install webext-dynamic-content-scripts
// This module is only offered as a ES Module
import 'webext-dynamic-content-scripts';

Usage

For Manifest v2, refer to the usage-mv2 documentation.

Manifest v3 supporting is coming soon.

Related

Permissions

Others

  • webext-options-sync - Helps you manage and autosave your extension's options. Chrome and Firefox.
  • webext-storage-cache - Map-like promised cache storage with expiration. Chrome and Firefox
  • webext-detect-page - Detects where the current browser extension code is being run. Chrome and Firefox.
  • web-ext-submit - Wrapper around Mozilla’s web-ext to submit extensions to AMO.
  • Awesome-WebExtensions - A curated list of awesome resources for WebExtensions development.

License

MIT © Federico Brigante