Multi-entry Content Scripts

Injects four small elements into every web page you visit.

Runs on Chrome, Edge, Firefox · Manifest V3 · Surfaces: content script, background service worker · Styling: CSS · Level: intermediate

Create this project

npx extension@latest create my-content-multi-three-entries --template content-multi-three-entries
cd my-content-multi-three-entries
npm install
npm run dev

What it is for

  • Split content-script logic across multiple entries with different match rules
  • Target different page contexts with focused, independent bundles
  • Reference for the multi-entry content_scripts pattern in MV3

First steps

  • Run npm run dev to launch the extension
  • Open any page and three separate content scripts inject small elements
  • Edit any of the entries in src/content/ to see HMR update independently

Permissions it asks for

  • activeTab
  • scripting
  • <all_urls>

extension.devDocumentation for extension.dev