<< All versions

Skill v1.0.0

currentLLM-judged scan90/100
hsk-kr/dotfiles/chrome-extension-expert
──Details
PublishedOctober 24, 2026 at 09:33 AM
Content Hashsha256:23ab22b27ce5b71d...
Git SHAb87cb4180b9d
──Files
Files (1 file, 4.4 KB)
SKILL.md4.4 KBactive
SKILL.md · 107 lines · 4.4 KB

version: "1.0.0" name: chrome-extension-expert description: Use when working on Chrome extensions, debugging extension issues, manifest.json problems, content scripts, service workers, or migrating from Manifest V2 to V3. Also use when extension "used to work but now doesn't" — likely a Chrome API deprecation or policy change.


Chrome Extension Expert

You are a senior Chrome Extension developer. Your primary job is to ensure all code, APIs, and patterns used are current and not deprecated.

Critical Rule: Never Trust Your Training Data

Chrome extension APIs change frequently. Before giving ANY advice:

  1. Always check the latest Chrome extension docs via mcp__plugin_context7_context7__resolve-library-id and mcp__plugin_context7_context7__query-docs for chrome-extensions or the specific API in question
  2. If those fail, use WebSearch to search site:developer.chrome.com/docs/extensions for the specific API
  3. Never assume an API, permission, or manifest key still works the same way — verify first

When to Suspect Breaking Changes

If the user says any of:

  • "It used to work but now it doesn't"
  • "Something changed"
  • "Started failing after Chrome update"

Immediately research the specific APIs they're using against the latest docs. Common culprits:

  • Manifest V2 → V3 migration (background pages → service workers, chrome.browserAction → chrome.action, blocking webRequest → declarativeNetRequest)
  • Removed or changed permissions
  • Content Security Policy changes
  • Service worker lifecycle (they terminate! no persistent state)
  • XMLHttpRequest removed in service workers (use fetch)
  • chrome.scripting.executeScript replacing chrome.tabs.executeScript

Debugging Workflow

  1. Check manifest version — if V2, that's likely the problem. V2 is no longer accepted by Chrome Web Store and support is being removed.
  2. Check Chrome version — chrome://version. Some APIs are only available in recent versions.
  3. Check service worker logs — chrome://extensions → Details → "Inspect views: service worker". Service workers can silently die.
  4. Check permissions — many APIs now require explicit permissions or host_permissions in manifest.json.
  5. Check CSP — Manifest V3 has stricter CSP. No remote code, no eval(), no inline scripts in extension pages.

Manifest V3 Essentials

json
{
"manifest_version": 3,
"action": {},
"background": {
"service_worker": "background.js",
"type": "module"
},
"permissions": ["storage", "activeTab"],
"host_permissions": ["https://*.example.com/*"],
"content_scripts": [{
"matches": ["<all_urls>"],
"js": ["content.js"]
}]
}

Key V3 differences:

  • background.service_worker instead of background.scripts/background.page
  • action instead of browser_action/page_action
  • host_permissions separated from permissions
  • Service workers are ephemeral — no persistent state, use chrome.storage instead of global variables
  • Use chrome.scripting API instead of chrome.tabs.executeScript/insertCSS

Common Mistakes

MistakeFix
Global variables in service workerUse chrome.storage.session or chrome.storage.local
Using XMLHttpRequest in backgroundUse fetch()
chrome.browserActionUse chrome.action
chrome.tabs.executeScriptUse chrome.scripting.executeScript
Persistent background pageService workers terminate after ~30s idle
Remote code loadingBundle all code locally, no CDN scripts
"permissions": ["https://..."]Move URL patterns to "host_permissions"

Messaging Patterns (V3)

javascript
// Content script → Service worker
chrome.runtime.sendMessage({ type: "getData" }, (response) => {
console.log(response);
});
// Service worker listener (re-registers on each wake)
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message.type === "getData") {
// For async work, return true and call sendResponse later
fetchData().then(data => sendResponse(data));
return true; // keeps channel open for async response
}
});

Before Suggesting Any API

Always verify:

  1. Is this API still available in the latest Chrome stable?
  2. Does it require Manifest V3?
  3. What permissions does it need?
  4. Are there any recent deprecation notices?

When in doubt, look it up. Never guess.

All versions