Skill

Develop Manifest V3 Chrome Extensions

Senior Chrome Extension developer persona for Manifest V3 - service workers, message passing, and least-privilege security.

Works with chrome

91
Spark score
out of 100
Updated last month
Version 13.1.0

Add to Favorites

Why it matters

Build robust and secure Chrome Extensions using modern Manifest V3 architecture. This skill focuses on service workers, cross-script communication, and secure API implementation for production-ready applications.

Outcomes

What it gets done

01

Design and implement new Chrome Extensions from scratch.

02

Migrate existing extensions from Manifest V2 to Manifest V3.

03

Implement service workers, content scripts, and UI components.

04

Debug message passing and extension-specific APIs.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/ag-chrome-extension-developer | bash

Overview

Chrome Extension Developer

Chrome Extension developer skill for Manifest V3 architecture, covering service worker vs content script vs UI context separation, reliable chrome.runtime message passing, least-privilege permissions, chrome.storage over localStorage, and chrome.alarms for scheduled background work since service workers are ephemeral. Use when building or migrating a Chrome Extension to Manifest V3, implementing service workers/content scripts, or debugging cross-context message passing.

What it does

This skill acts as a senior Chrome Extension developer specializing in modern Manifest V3 architecture, cross-script communication, and production-ready security practices. Its core instructions are Manifest V3 only (always prioritizing Service Workers over the deprecated Background Pages), clear context separation between Service Workers (background), Content Scripts (DOM-accessible), and UI contexts (popups, options pages), reliable message passing via chrome.runtime.sendMessage/chrome.tabs.sendMessage with the response callback always used, following the principle of least privilege in permissions (preferring optional_permissions where possible), using chrome.storage.local/chrome.storage.sync instead of localStorage for persistent data, and using declarativeNetRequest for network filtering or modification rather than older blocking-webRequest approaches. A basic Manifest V3 structure example shows the manifest_version: 3 declaration, an action with a default popup, a background.service_worker entry, a content_scripts match pattern, and a minimal permissions array (storage, activeTab). A message-passing example shows a service worker's chrome.runtime.onMessage listener checking a message type, sending a response via sendResponse, and explicitly returning true to keep the message channel open for an asynchronous response. Best practices: use chrome.runtime.onInstalled for extension initialization, use modern ES modules in scripts when the manifest is configured for them, validate external input in content scripts before acting on it, avoid innerHTML/eval() in favor of textContent and safe DOM APIs to prevent injection, and never block the main thread in the service worker since it must remain responsive. A troubleshooting note addresses a common pitfall: background service workers are ephemeral and can be killed, so scheduled tasks should use chrome.alarms rather than setTimeout/setInterval, which may simply stop firing when the worker goes inactive.

When to use - and when NOT to

Use this skill when designing and building new Chrome Extensions from scratch, migrating an extension from Manifest V2 to Manifest V3, implementing service workers/content scripts/popup or options pages, debugging cross-context message passing, or implementing extension-specific APIs (storage, permissions, alarms, side panel). Do not use it for Safari App Extensions (a dedicated Safari extension skill applies there), Firefox development without the WebExtensions API, or general web development that doesn't touch extension-specific APIs at all.

Inputs and outputs

Input is a Chrome Extension's intended functionality, an existing Manifest V2 extension to migrate, or a cross-context communication bug to debug. Output is a Manifest V3-compliant extension structure - manifest, service worker, content scripts, UI contexts - with least-privilege permissions, safe DOM handling, and reliable message-passing patterns.

Integrations

Built on the Chrome Extensions Manifest V3 platform (chrome.runtime, chrome.tabs, chrome.storage, chrome.alarms, declarativeNetRequest APIs), distinct from Safari App Extensions and Firefox's WebExtensions API.

{
  "manifest_version": 3,
  "name": "My Agentic Extension",
  "version": "1.0.0",
  "background": {
    "service_worker": "background.js"
  },
  "permissions": ["storage", "activeTab"]
}

Who it's for

Developers building or migrating Chrome Extensions who need Manifest V3-compliant architecture, reliable cross-context message passing, and production-grade security practices around permissions and DOM handling.

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.