chrome-extension

Guides building, debugging, and publishing Chrome extensions with Manifest V3.

Updated May 23, 2026
One-click install
npx skills add https://github.com/Oatse/CWE-Automation --skill chrome-extension-oatse
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chrome-extension
Source: https://github.com/Oatse/CWE-Automation/tree/main/.agents/skills/chrome-extension
Command: npx skills add https://github.com/Oatse/CWE-Automation --skill chrome-extension-oatse

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Chrome extension development under Manifest V3 involves tricky constraints—ephemeral service workers, CSP-blocked content scripts, async messaging pitfalls, and strict Web Store review rules—that cause frequent bugs and rejections for developers. ## Core Features & Use Cases - Architecture Guidance: Explains the five execution contexts (service worker, popup, options, side panel, content scripts) and how they communicate via chrome.runtime messaging, ports, and storage events. - Implementation References: Provides deep-dive reference files for manifest.json, service workers, content scripts, messaging/RPC layers, storage, CSP bypass relays, permissions, and TypeScript builds. - Debugging & Publishing: Covers common MV3 mistakes (missing return true, SW termination, orphaned content scripts) and the Chrome Web Store submission process. - Use Case: When you need a content script to call an API on a page with a strict CSP, this Skill walks you through relaying the request through the service worker with an allowlist. ## Quick Start Ask the AI to help you build a Chrome extension with Manifest V3, for example to scaffold a manifest.json and service worker for a new extension project.

Frequently Asked Questions about chrome-extension

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a Chrome extension with Manifest V3?

Start with a minimal manifest.json declaring manifest_version 3, a service worker background script, and least-privilege permissions like activeTab and scripting. Then add content scripts, UI surfaces, and messaging between contexts as needed.

How do content scripts bypass page CSP to call an API?

Content scripts are bound by the page's connect-src CSP, so they relay requests through the service worker, which is not subject to page CSP. The service worker performs the fetch with host_permissions and returns the result via chrome.runtime messaging.

Why does my async chrome.runtime message listener never respond?

Async functions return a Promise, but Chrome requires the listener to return literal true to keep the response channel open. Wrap the async logic in a synchronous handler that returns true and calls sendResponse when the promise resolves.

Can I use setTimeout in a Manifest V3 service worker?

No, service workers terminate after 30 seconds of inactivity, cancelling any timers. Use chrome.alarms for periodic tasks (minimum 30-second interval) and persist state to chrome.storage.session instead of global variables.

What happens to content scripts when a Chrome extension updates?

Existing content scripts become orphaned: they keep running but lose access to chrome.runtime, causing errors. Detect this by checking chrome.runtime?.id before calls and show a banner prompting the user to refresh the page.

Does Manifest V3 still support blocking webRequest?

No, blocking webRequest was removed in MV3. Use declarativeNetRequest with static or dynamic rules to block requests, redirect URLs, or modify headers, subject to rule count limits.