chrome-extension-mv3
Skill2 starsChanged 41 days agoMITView on GitHub
Manifest V3 Chrome extension development — service worker lifecycle, message passing (popup ↔ service worker ↔ content script), content script injection, and host_permissions fetch patterns. Use when editing manifest.json, background/service worker, popup, content scripts, chrome.runtime.sendMessage, or extension permissions.
In this repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adversarial-auditSkill
- agentic-reactorSkill
- agent-orchestratorSkill
- ai-optimizationSkill
- architecture-synthesisSkill
- audit-allow-buildsSkill
- audit-ide-dependenciesSkill
- author-workflow-skillSkill
- bdd-strategizerSkill
- concurrent-cli-agentsSkill
- control-feederSkill
- control-graphSkill
- cursor-transcript-harvestSkill
- cv-promote-guardSkill
- devcontainer-hardenedSkill
- dual-copy-skill-publishSkill
- explore-repo-readonlySkill
- finder-reactorSkill
- fix-dependency-securitySkill
- fusion-sageSkill
- git-worktreesSkill
- grok-host-prepSkill
- gt-flowSkill
- higher-order-decision-architectSkill
- looperSkill
- master-plannerSkill
- mvu-refactor-planSkill
- odysseus-navigatorSkill
- project-editor-profileSkill
- react-client-expertSkill
- semantic-markup-cssSkill
- semantic-nameSkill
- session-unit-orderSkill
- shell-kernel-ontologySkill
- skill-rename-propagationSkill
- split-to-prsSkill
- src-tree-reorganizeSkill
- stellar-roadmapSkill
- stellar-spacemapSkill
- subagent-delegationSkill
- subagent-explore-reportSkill
- supply-chain-hardenSkill
- tauri-agenticSkill
- tauri-ipc-debugSkill
- tidy-commit-pushSkill
- upgrade-packagesSkill
- verification-cockpitSkill
- x-agent-resourcesSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
Read the project's overlay or TECH_DETAILS*.md / AGENTS.md for exact filenames.
- Very specific: line 28
Service worker state: no globals — use chrome.storage / IndexedDB.
- Very specific: line 30
Manifest assets: only reference icons/paths that exist.
- Very specific: line 51
Search guides: npx -y modern-web-guidance@latest search "…" — do not copy the full guide tree into your repo.
- Very specific: line 55
If the repo ships a file map, message action table, or domain-specific fetch rules, load it from …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Chrome extension (Manifest V3)
Vanilla MV3 patterns for extensions without a bundler/framework in the active path. Pair with project overlays for app-specific file maps and message action names (examples/overlays/).
Architecture (typical three-layer)
| Layer | Runs in | Typical files | Responsibilities |
| Popup / UI | Extension page | popup.html, popup.js | User input, display, orchestrates messages to SW |
| Service worker | Background (ephemeral) | background.js, event.js, sw.js | Network fetch needing host_permissions, relay, durable cache |
| Content script | Isolated world on web pages | content.js | DOM/selection access, page context, no extension APIs for cross-origin fetch |
Read the project's overlay or TECH_DETAILS*.md / AGENTS.md for exact filenames.
Rules for changes
- Async
sendResponse: async work in message handlers → IIFE +return true, or return a Promise (Chrome 99+ only). See references/message-passing.md. - Cross-origin fetch: pages and popups cannot bypass host restrictions — fetch from the service worker when
host_permissionsare declared; never duplicate fetch in popup if SW already owns that origin. - Service worker state: no globals — use
chrome.storage/ IndexedDB; listeners registered at top level. See references/service-worker.md. - Selection: cache selection in the content script; popup open often clears live
window.getSelection(). - Manifest assets: only reference icons/paths that exist; MV3 requires
service_workernotbackground.scripts. - Content scripts: isolated world — use messaging for SW coordination. See references/content-scripts.md.
Message passing checklist
- [ ] Action/type names match across popup, SW, and content script
- [ ] Async handlers: return true (IIFE) or return Promise — not both
- [ ] tabs.sendMessage: handle "receiving end does not exist" (script not injected yet)
- [ ] Only one listener should sendResponse per message typeMV3 references (this skill)
- message-passing.md — popup ↔ service worker ↔ content script
- service-worker.md — lifecycle, storage, alarms
- content-scripts.md — injection, DOM, messaging
Upstream (do not vendor)
- GoogleChrome/modern-web-guidance — chrome-extensions
- Search guides:
npx -y modern-web-guidance@latest search "…"— do not copy the full guide tree into your repo.
Project overlay
If the repo ships a file map, message action table, or domain-specific fetch rules, load it from .agents/skills/chrome-extension-mv3/references/ or examples/overlays/sorkalam-mv3-extension.md (Sorkalam dictionary extension).
Example provenance: sorkalam-extension.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

