[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BV3H8RKV5K5ST8W7074T85":3,"skill-same:01M7BV3H8RKV5K5ST8W7074T85":131},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7BV3H8RKV5K5ST8W7074T85","chrome-extensions",null,"Build and publish Chrome Extensions using Manifest V3 best practices. Use this skill whenever the user asks to create, modify, debug, or understand Chrome browser extensions, add-ons, or anything involving the Chrome Extensions API. Trigger on mentions of: 'Chrome extension', 'browser extension', 'manifest.json', 'content script', 'service worker' (in browser context), 'popup' (in browser extension context), 'side panel', 'chrome.* API', 'declarativeNetRequest', 'omnibox', 'context menu' (in extension context), or any request to build functionality that integrates with the Chrome browser UI. Also trigger for publishing to the Chrome Web Store: 'publish extension', preparing an extension for publishing, responding to a review rejection, writing permission justifications, or drafting a privacy policy.","nguyenhungtran18\u002Fskill-and-tool-tracker","nguyenhungtran18","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F297063550?v=4","01M7BV0BFPRRFP84F2ME0FYZ9D","01M7BV0BG83FA5P22NJV0GR0A5",1,"MIT","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: chrome-extensions\ndescription: >\n  Build and publish Chrome Extensions using Manifest V3 best practices. Use this skill\n  whenever the user asks to create, modify, debug, or understand Chrome browser extensions,\n  add-ons, or anything involving the Chrome Extensions API. Trigger on mentions of: 'Chrome\n  extension', 'browser extension', 'manifest.json', 'content script', 'service worker' (in\n  browser context), 'popup' (in browser extension context), 'side panel', 'chrome.* API',\n  'declarativeNetRequest', 'omnibox', 'context menu' (in extension context), or any request\n  to build functionality that integrates with the Chrome browser UI. Also trigger for\n  publishing to the Chrome Web Store: 'publish extension', preparing an extension for\n  publishing, responding to a review rejection, writing permission justifications, or\n  drafting a privacy policy.\n---\n\n# Chrome Extensions\n\nBuild production-quality Chrome extensions using Manifest V3 and publish them to the Chrome Web Store.\n\n## Part 1 — Building Extensions\n\n### Mandatory Rules\n\nThese address the most common causes of broken extensions. Violating any produces a non-functional build.\n\n#### 1. Icons: only reference files you create — or omit icons entirely\n\n```\n❌ BROKEN — referencing files that don't exist or reusing one file for all sizes:\n   \"icons\": { \"16\": \"icon.png\", \"48\": \"icon.png\", \"128\": \"icon.png\" }\n\n✅ CORRECT — each size is a separate file at the correct pixel dimensions:\n   \"icons\": { \"16\": \"icons\u002Ficon-16.png\", \"48\": \"icons\u002Ficon-48.png\", \"128\": \"icons\u002Ficon-128.png\" }\n   (where icon-16.png is 16×16px, icon-48.png is 48×48px, icon-128.png is 128×128px)\n\n✅ ALSO CORRECT — omit icons from manifest if you cannot generate real PNG files:\n   (just remove the \"icons\" and \"default_icon\" fields — Chrome uses a default icon)\n```\n\n**If you include icon references, you MUST create the actual image files.** Generate them with a script (see `references\u002Fextensions\u002Ficons.md`) or leave them out. Never reference non-existent files.\n\n#### 2. Side panel: you MUST provide a way to open it\n\nDefining `\"side_panel\": {\"default_path\": \"...\"}` does NOT make it openable. Add a trigger:\n\n```js\n\u002F\u002F In service-worker.js — open side panel on extension icon click\n\u002F\u002F IMPORTANT: chrome.action.onClicked ONLY fires when there is NO default_popup\nchrome.action.onClicked.addListener(async (tab) => {\n  await chrome.sidePanel.open({ windowId: tab.windowId });\n});\n```\n\nIf the extension has both a popup AND side panel, add a button in the popup that calls `chrome.sidePanel.open()`. Alternatively, use `chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true })` — but the property is `openPanelOnActionClick`, NOT `openPanelOnActionIconClick`; the \"Icon\" variant causes a synchronous TypeError that silently aborts the service worker. Do NOT also define `default_popup` when using `setPanelBehavior`. See `references\u002Fextensions\u002Fside-panel.md`.\n\n#### 3. Code execution: sandboxed iframes ONLY\n\nExtension CSP blocks `eval()`, `new Function()`, inline `\u003Cscript>` in all extension pages.\n\n```js\n\u002F\u002F ❌ BROKEN — direct iframe DOM access throws SecurityError\niframe.contentDocument.write(html);\n\n\u002F\u002F ❌ BROKEN — eval in extension page\neval(userCode); \u002F\u002F CSP blocks this\n\n\u002F\u002F ✅ OPTION A: Sandbox in manifest + postMessage\n\u002F\u002F manifest.json: { \"sandbox\": { \"pages\": [\"sandbox.html\"] } }\niframe.contentWindow.postMessage({ html, css, js }, '*');\n\u002F\u002F sandbox.html receives and runs:\nwindow.addEventListener('message', (e) => { eval(e.data.js); \u002F* allowed in sandbox *\u002F });\n\n\u002F\u002F ✅ OPTION B: Blob URL (creates separate origin, bypasses extension CSP)\niframe.src = URL.createObjectURL(new Blob([doc], { type: 'text\u002Fhtml' }));\n\n\u002F\u002F ✅ OPTION C: srcdoc\niframe.srcdoc = `\u003Cstyle>${css}\u003C\u002Fstyle>${html}\u003Cscript>${js}\u003C\\\u002Fscript>`;\n```\n\nSee `references\u002Fextensions\u002Fcsp-sandbox.md` for full details.\n\n#### 4. `tab.url` requires the `tabs` permission\n\nWithout it, `tab.url` silently returns `undefined` — no error thrown.\n\n```js\n\u002F\u002F manifest.json — REQUIRED if you read tab.url or tab.title anywhere:\n{ \"permissions\": [\"tabs\"] }\n```\n\nSee `references\u002Fextensions\u002Ftab-management.md`.\n\n#### 5. Always use async\u002Fawait — never `.then()` chains\n\n```js\n\u002F\u002F ❌ BAD\nchrome.tabs.query({active: true, currentWindow: true}).then(tabs => {\n  chrome.scripting.executeScript({target: {tabId: tabs[0].id}, files: ['content.js']}).then(() => {});\n});\n\n\u002F\u002F ✅ GOOD\nconst [tab] = await chrome.tabs.query({ active: true, currentWindow: true });\nawait chrome.scripting.executeScript({ target: { tabId: tab.id }, files: ['content.js'] });\n```\n\nFor `runtime.onMessage` listeners that do async work:\n\n```js\nchrome.runtime.onMessage.addListener((message, sender, sendResponse) => {\n  (async () => {\n    const data = await chrome.storage.local.get('key');\n    sendResponse({ data });\n  })();\n  return true; \u002F\u002F keeps channel open\n});\n```\n\n#### 6. Content scripts: don't block the main thread\n\nWhen modifying many DOM elements, batch with `requestAnimationFrame` and yield between batches:\n\n```js\nasync function highlightAll(elements) {\n  const BATCH = 20;\n  for (let i = 0; i \u003C elements.length; i += BATCH) {\n    await new Promise(r => requestAnimationFrame(() => {\n      elements.slice(i, i + BATCH).forEach(el => el.style.backgroundColor = 'yellow');\n      r();\n    }));\n    if (globalThis.scheduler?.yield) await scheduler.yield();\n  }\n}\n```\n\nSee `references\u002Fextensions\u002Fcontent-scripts.md`.\n\n#### 7. Service workers are ephemeral — never store state in variables\n\n```js\n\u002F\u002F ❌ BROKEN — state lost when SW terminates (~30s of inactivity)\nlet count = 0;\nchrome.tabs.onUpdated.addListener(() => { count++; });\n\n\u002F\u002F ✅ CORRECT — persist in chrome.storage, read on every event\nchrome.tabs.onUpdated.addListener(async (tabId, changeInfo) => {\n  if (changeInfo.status !== 'complete') return;\n  const { count = 0 } = await chrome.storage.local.get('count');\n  await chrome.storage.local.set({ count: count + 1 });\n  await chrome.action.setBadgeText({ text: String(count + 1) });\n});\n```\n\nUse `chrome.alarms` instead of `setTimeout`\u002F`setInterval`. See `references\u002Fextensions\u002Fservice-worker.md`.\n\n#### 8. chrome.identity: extension ID differs between dev and production\n\nWhen using Google sign-in, the OAuth client_id is tied to a specific extension ID. The ID changes between unpacked development and the Chrome Web Store.\n\nTo stabilize the ID during development, add a `\"key\"` field to manifest.json:\n1. Pack the extension once (chrome:\u002F\u002Fextensions → Pack)\n2. Extract the public key from the .crx\n3. Add `\"key\": \"MIIBIjANBgkqh...\"` to manifest.json\n\nAlways document: \"After publishing to the Chrome Web Store, update the OAuth client with the store-assigned extension ID.\" See `references\u002Fextensions\u002Fauth-identity.md`.\n\n#### 9. Context menus: show user feedback after action\n\nWhen a context menu item performs an action (save, copy, etc.), confirm it to the user. Use a notification, badge flash, or injected toast — don't let actions happen silently. See `references\u002Fextensions\u002Fcontext-menus.md` for a complete toast implementation.\n\n#### 10. Prompt API: available in service workers, popup, and side panel\n\nThe `LanguageModel` API works in all extension contexts — service worker, popup, and side panel — with no additional manifest permissions required. Extensions also get `LanguageModel.params()`, which is unavailable on the web:\n\n```js\nconst params = await LanguageModel.params();\n\u002F\u002F { defaultTopK: 3, maxTopK: 128, defaultTemperature: 1, maxTemperature: 2 }\n```\n\nFor general Prompt API patterns (availability checks, session creation, streaming), use the `modern-web-guidance` skill. See `references\u002Fextensions\u002Fprompt-api.md` for the extension-specific wiring example.\n\n#### 11. `chrome.action` API requires `action` in manifest\n\nUsing `chrome.action.setBadgeText`, `chrome.action.setIcon`, or `chrome.action.onClicked` requires\nan `\"action\"` key in manifest.json — even if it's empty. Without it, `chrome.action` is `undefined`.\n\n```js\n\u002F\u002F ❌ BROKEN — manifest has no \"action\" key\nawait chrome.action.setBadgeText({ text: '5' });\n\u002F\u002F TypeError: Cannot read properties of undefined (reading 'setBadgeText')\n\n\u002F\u002F ✅ FIX — add \"action\" to manifest.json (at minimum an empty object)\n{ \"action\": {} }\n\u002F\u002F or with a popup:\n{ \"action\": { \"default_popup\": \"popup\u002Fpopup.html\" } }\n```\n\n#### 12. `activeTab` only works on direct user gestures — not from side panels\n\n`activeTab` grants temporary access to the current tab ONLY when triggered by:\n- Clicking the extension action icon\n- A context menu item\n- A keyboard shortcut from the `commands` API\n- Accepting an omnibox suggestion\n\nIt does **NOT** grant access when clicking a button in a side panel, popup button that opens later,\nor any programmatic trigger.\n\n```js\n\u002F\u002F ❌ BROKEN — activeTab does NOT work from a side panel button click\ndocument.getElementById('summarize').addEventListener('click', async () => {\n  const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });\n  await chrome.scripting.executeScript({ target: { tabId: tab.id }, func: () => document.body.innerText });\n});\n\n\u002F\u002F ✅ FIX — use \"tabs\" permission + specific host_permissions instead\n\u002F\u002F manifest.json: { \"permissions\": [\"tabs\", \"scripting\"], \"host_permissions\": [\"\u003Call_urls>\"] }\n```\n\nSee `references\u002Fextensions\u002Fside-panel.md`.\n\n#### 13. DevTools panel URLs are relative to the extension root\n\nWhen creating a DevTools panel, the panel HTML path is relative to the **extension root**, NOT\nrelative to the devtools page that calls `chrome.devtools.panels.create()`.\n\n```js\n\u002F\u002F ❌ BROKEN — path relative to devtools\u002F directory\nchrome.devtools.panels.create(\"My Panel\", \"\", \"panel\u002Fpanel.html\");\n\n\u002F\u002F ✅ CORRECT — full path from extension root\nchrome.devtools.panels.create(\"My Panel\", \"\", \"devtools\u002Fpanel\u002Fpanel.html\");\n```\n\nSee `references\u002Fextensions\u002Fdevtools.md`.\n\n#### 14. Offscreen documents have NO access to most chrome.* APIs\n\nOffscreen documents (`chrome.offscreen`) are **severely restricted**. Most `chrome.*` APIs\nare unavailable, including `chrome.downloads`, `chrome.tabs`, `chrome.action`, and others.\n\n```js\n\u002F\u002F ❌ BROKEN — chrome.downloads is undefined in offscreen documents\nchrome.downloads.download({ url, filename: 'recording.webm' }); \u002F\u002F TypeError\n\n\u002F\u002F ❌ BROKEN — chrome.action is undefined in offscreen documents\nchrome.action.setBadgeText({ text: 'REC' }); \u002F\u002F TypeError\n```\n\n**The only APIs available in offscreen documents are:**\n- `chrome.runtime.sendMessage` \u002F `chrome.runtime.onMessage`\n- `chrome.runtime.getURL`\n- Standard Web APIs (DOM, fetch, MediaRecorder, Canvas, Web Audio, etc.)\n\n**Rule of thumb:** Offscreen documents do the Web API work (recording, parsing, audio). The service worker does all chrome.* API work (downloads, badge updates, notifications). Use `chrome.runtime.sendMessage` to bridge between them. See `references\u002Fextensions\u002Fmessage-passing.md`.\n\n#### 15. Notifications and badge icons must reference real image files\n\n`chrome.notifications.create()` requires a valid `iconUrl` pointing to an actual image file.\nIf the file doesn't exist or the path is wrong, the call fails with `\"Unable to download all specified images.\"`\n\n```js\n\u002F\u002F ❌ BROKEN — icon file doesn't exist\nchrome.notifications.create('reminder', {\n  type: 'basic',\n  iconUrl: 'icons\u002Ficon-128.png', \u002F\u002F File not in extension!\n  title: 'Reminder',\n  message: 'Time is up!'\n});\n\n\u002F\u002F ✅ Generate a data URL at runtime via OffscreenCanvas — no file needed.\n\u002F\u002F See `references\u002Fextensions\u002Ficons.md` for a reusable implementation.\nconst iconUrl = await getIconDataUrl();\nchrome.notifications.create('reminder', { type: 'basic', iconUrl, title: 'Reminder', message: 'Time is up!' });\n```\n\nThis applies to ALL image references in chrome.* APIs — notifications, `chrome.action.setIcon`,\ncontext menu icons, etc. **If you reference a file, it must exist.**\n\n#### 16. Tab capture: guard against double-start with state locking\n\n`chrome.tabCapture.getMediaStreamId()` fails with `\"Cannot capture a tab with an active stream\"`\nif called while a previous capture is still active. Fast double-clicks on the extension icon\neasily trigger this. Use explicit state locking:\n\n```js\n\u002F\u002F ❌ BROKEN — no guard against rapid clicks\nlet isRecording = false;\nchrome.action.onClicked.addListener(async (tab) => {\n  if (isRecording) { stopRecording(); isRecording = false; }\n  else { isRecording = true; startRecording(tab); } \u002F\u002F Second click = \"active stream\" error\n});\n\n\u002F\u002F ✅ CORRECT — use transitional states to lock out concurrent operations\n\u002F\u002F State machine: 'idle' → 'starting' → 'recording' → 'stopping' → 'idle'\n\u002F\u002F Store state in chrome.storage.session (survives SW restart, cleared on browser close)\nchrome.action.onClicked.addListener(async (tab) => {\n  const { recordingState = 'idle' } = await chrome.storage.session.get('recordingState');\n\n  if (recordingState === 'starting' || recordingState === 'stopping') return;\n\n  if (recordingState === 'idle') {\n    await chrome.storage.session.set({ recordingState: 'starting' });\n    try {\n      await startRecording(tab);\n      await chrome.storage.session.set({ recordingState: 'recording' });\n      await chrome.action.setBadgeText({ text: 'REC' });\n      await chrome.action.setBadgeBackgroundColor({ color: '#FF0000' });\n    } catch (err) {\n      console.error('Failed to start recording:', err);\n      await chrome.storage.session.set({ recordingState: 'idle' });\n    }\n  } else if (recordingState === 'recording') {\n    await chrome.storage.session.set({ recordingState: 'stopping' });\n    try { await stopRecording(); }\n    finally {\n      await chrome.storage.session.set({ recordingState: 'idle' });\n      await chrome.action.setBadgeText({ text: '' });\n    }\n  }\n});\n```\n\nThis pattern applies to any chrome API that manages exclusive resources:\n`chrome.tabCapture`, `chrome.desktopCapture`, `chrome.offscreen.createDocument` (only one\noffscreen document allowed at a time). See `references\u002Fextensions\u002Fmedia-capture.md`.\n\n#### 17. `chrome.desktopCapture` requires a target tab with URL access\n\nWhen calling `chrome.desktopCapture.chooseDesktopMedia()` from a service worker, you must pass\nthe active tab as the `targetTab` parameter. The tab object must have its `url` field populated,\nwhich requires the `\"tabs\"` permission.\n\n```js\n\u002F\u002F ❌ BROKEN — called without targetTab from service worker\nchrome.desktopCapture.chooseDesktopMedia(['screen', 'window'], (streamId) => { ... });\n\u002F\u002F Error: \"A target tab is required when called from a service worker context.\"\n\n\u002F\u002F ❌ BROKEN — tab doesn't have url field (missing \"tabs\" permission)\nconst [tab] = await chrome.tabs.query({ active: true, currentWindow: true });\nchrome.desktopCapture.chooseDesktopMedia(['screen', 'window'], tab, (streamId) => { ... });\n\u002F\u002F Error: \"targetTab doesn't have URL field set.\"\n\n\u002F\u002F ✅ CORRECT — \"tabs\" permission in manifest + pass tab object\n\u002F\u002F manifest.json: { \"permissions\": [\"tabs\", \"desktopCapture\"] }\nconst [tab] = await chrome.tabs.query({ active: true, currentWindow: true });\nchrome.desktopCapture.chooseDesktopMedia(['screen', 'window'], tab, (streamId) => {\n  if (!streamId) return; \u002F\u002F User cancelled\n});\n```\n\n**Note:** Prefer `chrome.tabCapture.getMediaStreamId()` for tab-only recording. Use `chrome.desktopCapture` only when the user should choose which screen\u002Fwindow to capture. See `references\u002Fextensions\u002Fmedia-capture.md`.\n\n#### 18. `chrome.windows` has NO `.query()` method — use `getAll`, `getLastFocused`, or `getCurrent`\n\nUnlike `chrome.tabs.query()`, the `chrome.windows` API does NOT have a `.query()` method.\n\n```js\n\u002F\u002F ❌ BROKEN — chrome.windows.query does not exist\nconst windows = await chrome.windows.query({ focused: true });\n\u002F\u002F TypeError: chrome.windows.query is not a function\n\n\u002F\u002F ✅ CORRECT — use the right method for your need\nconst focused = await chrome.windows.getLastFocused({ populate: true });\nconst current = await chrome.windows.getCurrent({ populate: true });\nconst all     = await chrome.windows.getAll({ populate: true });\n```\n\n**`chrome.windows` methods:** `getAll`, `getLastFocused`, `getCurrent`, `get(windowId)`, `create`, `update`, `remove`. See `references\u002Fextensions\u002Ftab-management.md`.\n\n### Always Manifest V3\n\nNever generate Manifest V2 code.\n- `background.service_worker` not `background.scripts`\n- `chrome.action` not `chrome.browserAction`\n- `chrome.scripting.executeScript` not `chrome.tabs.executeScript`\n- `host_permissions` is separate from `permissions`\n- No inline scripts in HTML — use `\u003Cscript src=\"file.js\">`\n- No inline event handlers — use `addEventListener`\n\n---\n\n## Part 2 — Publishing to the Chrome Web Store\n\nManage `CHROMEWEBSTORE.md` — the single source of truth for all Chrome Web Store listing\nmetadata, permissions justifications, privacy disclosures, version history, and publishing\nreadiness for a Chrome extension project.\n\n### Core Workflow\n\nEvery time you touch a Chrome extension project in a way that affects its store presence,\nupdate (or create) `CHROMEWEBSTORE.md` in the project root. The file tracks everything the\ndeveloper needs to fill out in the Chrome Developer Dashboard, so they can copy-paste from\na single doc instead of scrambling at publish time.\n\n#### When to create CHROMEWEBSTORE.md\n\nCreate it the moment any of these happen:\n- The user says they want to publish an extension\n- The user asks to \"prepare for the store\" or \"get ready to publish\"\n- You're building a new extension that will clearly end up on the store\n- The user asks about store listing requirements\n\nUse the template in `references\u002Fwebstore\u002Fchromewebstore-template.md` as your starting point. Read it\nbefore generating the file.\n\n#### When to update CHROMEWEBSTORE.md\n\nUpdate it whenever:\n- **User-facing changes**: Bump the \"Last Updated\" date, update the feature list in\n  descriptions, and add an entry to Version History\n- **manifest.json changes**: If permissions, host_permissions, or content_scripts changed,\n  update the Permissions Justification section — every permission needs a plain-English\n  reason the review team can understand\n- **New release**: Add a Version History entry with version number, date, and summary\n- **Privacy-relevant changes**: If data collection, storage, or transmission changed,\n  update the Privacy & Data Use section and the privacy policy\n- **Asset changes**: If icons or UI changed, note which screenshots need refreshing\n- **Rejection response**: If the user reports a CWS rejection, update the file with the\n  fix and add a note to Version History\n\n#### How to fill it out\n\nFor each section, pull information from the actual project files:\n1. Read `manifest.json` to extract name, version, description, permissions, host_permissions\n2. Scan the codebase for data collection (storage, fetch calls, analytics)\n3. Check for icon files and their dimensions\n4. Look at the extension's UI to understand features for the description\n\nWrite store-facing copy in a tone that is specific, honest, and benefit-oriented. The Chrome\nWeb Store review team rejects vague descriptions. \"Makes your life easier\" will be rejected.\n\"Highlights search results on any webpage and lets you save highlights to a local list\" will\npass.\n\n### CHROMEWEBSTORE.md Sections\n\nRead `references\u002Fwebstore\u002Fchromewebstore-template.md` before generating the file — it defines\nwhat each section covers and how to fill it out. The highest-risk section is Permissions\nJustification: write a specific plain-English reason per permission and per host_permission.\n\"Needed for the extension to work\" will be rejected. Read `references\u002Fwebstore\u002Fprivacy-policy.md`\nfor guidance on generating a privacy policy.\n\n### Pre-Publish Checklist\n\nBefore submission, run through `references\u002Fwebstore\u002Freview-checklist.md`. The most common\nfirst-submission failures:\n- Every permission and host_permission must have a specific justification (not \"needed to work\")\n- Privacy policy URL must be live and match the data use disclosure form\n- At least 1 screenshot at 1280×800 or 640×400\n- ZIP must exclude `.git\u002F`, `node_modules\u002F`, `.env`, `CHROMEWEBSTORE.md`\n\n### Store Listing Copy Guidelines\n\nFor copy guidelines and common rejection reasons, see `references\u002Fwebstore\u002Fstore-listing.md`.\nKey rule: lead with function (\"Highlights search terms on any webpage\"), not feeling (\"Enjoy\nsearching again\").\n\n---\n\n## Reference Files\n\nFor detailed API patterns and publishing guidance, read the relevant file BEFORE writing code or content:\n\n| Topic | Reference |\n|-------|-----------|\n| Side panels | `references\u002Fextensions\u002Fside-panel.md` |\n| Content scripts & DOM | `references\u002Fextensions\u002Fcontent-scripts.md` |\n| Popups | `references\u002Fextensions\u002Fpopup-ui.md` |\n| Service worker lifetime | `references\u002Fextensions\u002Fservice-worker.md` |\n| Code execution & CSP | `references\u002Fextensions\u002Fcsp-sandbox.md` |\n| API calls | `references\u002Fextensions\u002Fapi-calling.md` |\n| Declarative Net Request | `references\u002Fextensions\u002Fdeclarative-net-request.md` |\n| Chrome Prompt API | `references\u002Fextensions\u002Fprompt-api.md` |\n| DevTools panels | `references\u002Fextensions\u002Fdevtools.md` |\n| Authentication | `references\u002Fextensions\u002Fauth-identity.md` |\n| Context menus | `references\u002Fextensions\u002Fcontext-menus.md` |\n| Omnibox | `references\u002Fextensions\u002Fomnibox.md` |\n| Storage | `references\u002Fextensions\u002Fstorage.md` |\n| Tab & window management | `references\u002Fextensions\u002Ftab-management.md` |\n| Tab\u002Fdesktop capture | `references\u002Fextensions\u002Fmedia-capture.md` |\n| Message passing | `references\u002Fextensions\u002Fmessage-passing.md` |\n| Icons | `references\u002Fextensions\u002Ficons.md` |\n| CHROMEWEBSTORE.md template | `references\u002Fwebstore\u002Fchromewebstore-template.md` |\n| Privacy policy guidance | `references\u002Fwebstore\u002Fprivacy-policy.md` |\n| Pre-publish review checklist | `references\u002Fwebstore\u002Freview-checklist.md` |\n| Store listing tips & rejections | `references\u002Fwebstore\u002Fstore-listing.md` |\n\n## Output Checklist\n\nVerify EVERY item before delivering:\n\n- [ ] `manifest_version: 3` — no V2 APIs anywhere\n- [ ] All icon files referenced in manifest exist as real files with correct dimensions — or icons are omitted\n- [ ] Side panel has an explicit open trigger (not just a manifest declaration)\n- [ ] Code execution uses sandbox\u002Fblob\u002Fsrcdoc — no `eval()` in extension pages\n- [ ] `tabs` permission declared if `tab.url` or `tab.title` is accessed\n- [ ] All code uses `async`\u002F`await` — no `.then()` chains\n- [ ] Content scripts batch DOM updates with `requestAnimationFrame`\n- [ ] Service worker stores NO state in global variables — uses `chrome.storage`\n- [ ] No inline scripts or event handlers in HTML\n- [ ] Context menu actions show user confirmation\n- [ ] `\"action\": {}` (or more) present in manifest if using `chrome.action.*` APIs\n- [ ] If reading\u002Fscripting tabs from a side panel: use `tabs` + `host_permissions` (NOT `activeTab`)\n- [ ] DevTools panel paths in `chrome.devtools.panels.create()` are relative to extension root\n- [ ] Offscreen documents use ONLY `chrome.runtime` messaging — no `chrome.downloads`, `chrome.action`, etc.\n- [ ] All image refs in `chrome.notifications`, `chrome.action.setIcon`, etc. point to real files (or use data URLs)\n- [ ] Tab\u002Fdesktop capture uses state locking to prevent double-start errors\n- [ ] `chrome.desktopCapture.chooseDesktopMedia` passes `targetTab` with `tabs` permission\n- [ ] `chrome.windows` calls use `getAll`\u002F`getLastFocused`\u002F`getCurrent` — NOT `.query()` (it doesn't exist)\n- [ ] `sidePanel.setPanelBehavior` uses `openPanelOnActionClick` — NOT `openPanelOnActionIconClick`\n- [ ] Error handling on all async operations\n- [ ] `host_permissions` scoped to specific domains (not `\u003Call_urls>` unless needed)\n- [ ] `return true` in `onMessage` listeners with async responses\n","# Chrome Extensions\n\nBuild production-quality Chrome extensions using Manifest V3 and publish them to the Chrome Web Store.\n\n## Part 1 — Building Extensions\n\n### Mandatory Rules\n\nThese address the most common causes of broken extensions. Violating any produces a non-functional build.\n\n#### 1. Icons: only reference files you create — or omit icons entirely\n\n```\n❌ BROKEN — referencing files that don't exist or reusing one file for all sizes:\n   \"icons\": { \"16\": \"icon.png\", \"48\": \"icon.png\", \"128\": \"icon.png\" }\n\n✅ CORRECT — each size is a separate file at the correct pixel dimensions:\n   \"icons\": { \"16\": \"icons\u002Ficon-16.png\", \"48\": \"icons\u002Ficon-48.png\", \"128\": \"icons\u002Ficon-128.png\" }\n   (where icon-16.png is 16×16px, icon-48.png is 48×48px, icon-128.png is 128×128px)\n\n✅ ALSO CORRECT — omit icons from manifest if you cannot generate real PNG files:\n   (just remove the \"icons\" and \"default_icon\" fields — Chrome uses a default icon)\n```\n\n**If you include icon references, you MUST create the actual image files.** Generate them with a script (see `references\u002Fextensions\u002Ficons.md`) or leave them out. Never reference non-existent files.\n\n#### 2. Side panel: you MUST provide a way to open it\n\nDefining `\"side_panel\": {\"default_path\": \"...\"}` does NOT make it openable. Add a trigger:\n\n```js\n\u002F\u002F In service-worker.js — open side panel on extension icon click\n\u002F\u002F IMPORTANT: chrome.action.onClicked ONLY fires when there is NO default_popup\nchrome.action.onClicked.addListener(async (tab) => {\n  await chrome.sidePanel.open({ windowId: tab.windowId });\n});\n```\n\nIf the extension has both a popup AND side panel, add a button in the popup that calls `chrome.sidePanel.open()`. Alternatively, use `chrome.sidePanel.setPanelBehavior({ openPanelOnActionClick: true })` — but the property is `openPanelOnActionClick`, NOT `openPanelOnActionIconClick`; the \"Icon\" variant causes a synchronous TypeError that silently aborts the service worker. Do NOT also define `default_popup` when using `setPanelBehavior`. See `references\u002Fextensions\u002Fside-panel.md`.\n\n#### 3. Code execution: sandboxed iframes ONLY\n\nExtension CSP blocks `eval()`, `new Function()`, inline `\u003Cscript>` in all extension pages.\n\n```js\n\u002F\u002F ❌ BROKEN — direct iframe DOM access throws SecurityError\niframe.contentDocument.write(html);\n\n\u002F\u002F ❌ BROKEN — eval in extension page\neval(userCode); \u002F\u002F CSP blocks this\n\n\u002F\u002F ✅ OPTION A: Sandbox in manifest + postMessage\n\u002F\u002F manifest.json: { \"sandbox\": { \"pages\": [\"sandbox.html\"] } }\niframe.contentWindow.postMessage({ html, css, js }, '*');\n\u002F\u002F sandbox.html receives and runs:\nwindow.addEventListener('message', (e) => { eval(e.data.js); \u002F* allowed in sandbox *\u002F });\n\n\u002F\u002F ✅ OPTION B: Blob URL (creates separate origin, bypasses extension CSP)\niframe.src = URL.createObjectURL(new Blob([doc], { type: 'text\u002Fhtml' }));\n\n\u002F\u002F ✅ OPTION C: srcdoc\niframe.srcdoc = `\u003Cstyle>${css}\u003C\u002Fstyle>${html}\u003Cscript>${js}\u003C\\\u002Fscript>`;\n```\n\nSee `references\u002Fextensions\u002Fcsp-sandbox.md` for full details.\n\n#### 4. `tab.url` requires the `tabs` permission\n\nWithout it, `tab.url` silently returns `undefined` — no error thrown.\n\n```js\n\u002F\u002F manifest.json — REQUIRED if you read tab.url or tab.title anywhere:\n{ \"permissions\": [\"tabs\"] }\n```\n\nSee `references\u002Fextensions\u002Ftab-management.md`.\n\n#### 5. Always use async\u002Fawait — never `.then()` chains\n\n```js\n\u002F\u002F ❌ BAD\nchrome.tabs.query({active: true, currentWindow: true}).then(tabs => {\n  chrome.scripting.executeScript({target: {tabId: tabs[0].id}, files: ['content.js']}).then(() => {});\n});\n\n\u002F\u002F ✅ GOOD\nconst [tab] = await chrome.tabs.query({ active: true, currentWindow: true });\nawait chrome.scripting.executeScript({ target: { tabId: tab.id }, files: ['content.js'] });\n```\n\nFor `runtime.onMessage` listeners that do async work:\n\n```js\nchrome.runtime.onMessage.addListener((message, sender, sendResponse) => {\n  (async () => {\n    const data = await chrome.storage.local.get('key');\n    sendResponse({ data });\n  })();\n  return true; \u002F\u002F keeps channel open\n});\n```\n\n#### 6. Content scripts: don't block the main thread\n\nWhen modifying many DOM elements, batch with `requestAnimationFrame` and yield between batches:\n\n```js\nasync function highlightAll(elements) {\n  const BATCH = 20;\n  for (let i = 0; i \u003C elements.length; i += BATCH) {\n    await new Promise(r => requestAnimationFrame(() => {\n      elements.slice(i, i + BATCH).forEach(el => el.style.backgroundColor = 'yellow');\n      r();\n    }));\n    if (globalThis.scheduler?.yield) await scheduler.yield();\n  }\n}\n```\n\nSee `references\u002Fextensions\u002Fcontent-scripts.md`.\n\n#### 7. Service workers are ephemeral — never store state in variables\n\n```js\n\u002F\u002F ❌ BROKEN — state lost when SW terminates (~30s of inactivity)\nlet count = 0;\nchrome.tabs.onUpdated.addListener(() => { count++; });\n\n\u002F\u002F ✅ CORRECT — persist in chrome.storage, read on every event\nchrome.tabs.onUpdated.addListener(async (tabId, changeInfo) => {\n  if (changeInfo.status !== 'complete') return;\n  const { count = 0 } = await chrome.storage.local.get('count');\n  await chrome.storage.local.set({ count: count + 1 });\n  await chrome.action.setBadgeText({ text: String(count + 1) });\n});\n```\n\nUse `chrome.alarms` instead of `setTimeout`\u002F`setInterval`. See `references\u002Fextensions\u002Fservice-worker.md`.\n\n#### 8. chrome.identity: extension ID differs between dev and production\n\nWhen using Google sign-in, the OAuth client_id is tied to a specific extension ID. The ID changes between unpacked development and the Chrome Web Store.\n\nTo stabilize the ID during development, add a `\"key\"` field to manifest.json:\n1. Pack the extension once (chrome:\u002F\u002Fextensions → Pack)\n2. Extract the public key from the .crx\n3. Add `\"key\": \"MIIBIjANBgkqh...\"` to manifest.json\n\nAlways document: \"After publishing to the Chrome Web Store, update the OAuth client with the store-assigned extension ID.\" See `references\u002Fextensions\u002Fauth-identity.md`.\n\n#### 9. Context menus: show user feedback after action\n\nWhen a context menu item performs an action (save, copy, etc.), confirm it to the user. Use a notification, badge flash, or injected toast — don't let actions happen silently. See `references\u002Fextensions\u002Fcontext-menus.md` for a complete toast implementation.\n\n#### 10. Prompt API: available in service workers, popup, and side panel\n\nThe `LanguageModel` API works in all extension contexts — service worker, popup, and side panel — with no additional manifest permissions required. Extensions also get `LanguageModel.params()`, which is unavailable on the web:\n\n```js\nconst params = await LanguageModel.params();\n\u002F\u002F { defaultTopK: 3, maxTopK: 128, defaultTemperature: 1, maxTemperature: 2 }\n```\n\nFor general Prompt API patterns (availability checks, session creation, streaming), use the `modern-web-guidance` skill. See `references\u002Fextensions\u002Fprompt-api.md` for the extension-specific wiring example.\n\n#### 11. `chrome.action` API requires `action` in manifest\n\nUsing `chrome.action.setBadgeText`, `chrome.action.setIcon`, or `chrome.action.onClicked` requires\nan `\"action\"` key in manifest.json — even if it's empty. Without it, `chrome.action` is `undefined`.\n\n```js\n\u002F\u002F ❌ BROKEN — manifest has no \"action\" key\nawait chrome.action.setBadgeText({ text: '5' });\n\u002F\u002F TypeError: Cannot read properties of undefined (reading 'setBadgeText')\n\n\u002F\u002F ✅ FIX — add \"action\" to manifest.json (at minimum an empty object)\n{ \"action\": {} }\n\u002F\u002F or with a popup:\n{ \"action\": { \"default_popup\": \"popup\u002Fpopup.html\" } }\n```\n\n#### 12. `activeTab` only works on direct user gestures — not from side panels\n\n`activeTab` grants temporary access to the current tab ONLY when triggered by:\n- Clicking the extension action icon\n- A context menu item\n- A keyboard shortcut from the `commands` API\n- Accepting an omnibox suggestion\n\nIt does **NOT** grant access when clicking a button in a side panel, popup button that opens later,\nor any programmatic trigger.\n\n```js\n\u002F\u002F ❌ BROKEN — activeTab does NOT work from a side panel button click\ndocument.getElementById('summarize').addEventListener('click', async () => {\n  const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });\n  await chrome.scripting.executeScript({ target: { tabId: tab.id }, func: () => document.body.innerText });\n});\n\n\u002F\u002F ✅ FIX — use \"tabs\" permission + specific host_permissions instead\n\u002F\u002F manifest.json: { \"permissions\": [\"tabs\", \"scripting\"], \"host_permissions\": [\"\u003Call_urls>\"] }\n```\n\nSee `references\u002Fextensions\u002Fside-panel.md`.\n\n#### 13. DevTools panel URLs are relative to the extension root\n\nWhen creating a DevTools panel, the panel HTML path is relative to the **extension root**, NOT\nrelative to the devtools page that calls `chrome.devtools.panels.create()`.\n\n```js\n\u002F\u002F ❌ BROKEN — path relative to devtools\u002F directory\nchrome.devtools.panels.create(\"My Panel\", \"\", \"panel\u002Fpanel.html\");\n\n\u002F\u002F ✅ CORRECT — full path from extension root\nchrome.devtools.panels.create(\"My Panel\", \"\", \"devtools\u002Fpanel\u002Fpanel.html\");\n```\n\nSee `references\u002Fextensions\u002Fdevtools.md`.\n\n#### 14. Offscreen documents have NO access to most chrome.* APIs\n\nOffscreen documents (`chrome.offscreen`) are **severely restricted**. Most `chrome.*` APIs\nare unavailable, including `chrome.downloads`, `chrome.tabs`, `chrome.action`, and others.\n\n```js\n\u002F\u002F ❌ BROKEN — chrome.downloads is undefined in offscreen documents\nchrome.downloads.download({ url, filename: 'recording.webm' }); \u002F\u002F TypeError\n\n\u002F\u002F ❌ BROKEN — chrome.action is undefined in offscreen documents\nchrome.action.setBadgeText({ text: 'REC' }); \u002F\u002F TypeError\n```\n\n**The only APIs available in offscreen documents are:**\n- `chrome.runtime.sendMessage` \u002F `chrome.runtime.onMessage`\n- `chrome.runtime.getURL`\n- Standard Web APIs (DOM, fetch, MediaRecorder, Canvas, Web Audio, etc.)\n\n**Rule of thumb:** Offscreen documents do the Web API work (recording, parsing, audio). The service worker does all chrome.* API work (downloads, badge updates, notifications). Use `chrome.runtime.sendMessage` to bridge between them. See `references\u002Fextensions\u002Fmessage-passing.md`.\n\n#### 15. Notifications and badge icons must reference real image files\n\n`chrome.notifications.create()` requires a valid `iconUrl` pointing to an actual image file.\nIf the file doesn't exist or the path is wrong, the call fails with `\"Unable to download all specified images.\"`\n\n```js\n\u002F\u002F ❌ BROKEN — icon file doesn't exist\nchrome.notifications.create('reminder', {\n  type: 'basic',\n  iconUrl: 'icons\u002Ficon-128.png', \u002F\u002F File not in extension!\n  title: 'Reminder',\n  message: 'Time is up!'\n});\n\n\u002F\u002F ✅ Generate a data URL at runtime via OffscreenCanvas — no file needed.\n\u002F\u002F See `references\u002Fextensions\u002Ficons.md` for a reusable implementation.\nconst iconUrl = await getIconDataUrl();\nchrome.notifications.create('reminder', { type: 'basic', iconUrl, title: 'Reminder', message: 'Time is up!' });\n```\n\nThis applies to ALL image references in chrome.* APIs — notifications, `chrome.action.setIcon`,\ncontext menu icons, etc. **If you reference a file, it must exist.**\n\n#### 16. Tab capture: guard against double-start with state locking\n\n`chrome.tabCapture.getMediaStreamId()` fails with `\"Cannot capture a tab with an active stream\"`\nif called while a previous capture is still active. Fast double-clicks on the extension icon\neasily trigger this. Use explicit state locking:\n\n```js\n\u002F\u002F ❌ BROKEN — no guard against rapid clicks\nlet isRecording = false;\nchrome.action.onClicked.addListener(async (tab) => {\n  if (isRecording) { stopRecording(); isRecording = false; }\n  else { isRecording = true; startRecording(tab); } \u002F\u002F Second click = \"active stream\" error\n});\n\n\u002F\u002F ✅ CORRECT — use transitional states to lock out concurrent operations\n\u002F\u002F State machine: 'idle' → 'starting' → 'recording' → 'stopping' → 'idle'\n\u002F\u002F Store state in chrome.storage.session (survives SW restart, cleared on browser close)\nchrome.action.onClicked.addListener(async (tab) => {\n  const { recordingState = 'idle' } = await chrome.storage.session.get('recordingState');\n\n  if (recordingState === 'starting' || recordingState === 'stopping') return;\n\n  if (recordingState === 'idle') {\n    await chrome.storage.session.set({ recordingState: 'starting' });\n    try {\n      await startRecording(tab);\n      await chrome.storage.session.set({ recordingState: 'recording' });\n      await chrome.action.setBadgeText({ text: 'REC' });\n      await chrome.action.setBadgeBackgroundColor({ color: '#FF0000' });\n    } catch (err) {\n      console.error('Failed to start recording:', err);\n      await chrome.storage.session.set({ recordingState: 'idle' });\n    }\n  } else if (recordingState === 'recording') {\n    await chrome.storage.session.set({ recordingState: 'stopping' });\n    try { await stopRecording(); }\n    finally {\n      await chrome.storage.session.set({ recordingState: 'idle' });\n      await chrome.action.setBadgeText({ text: '' });\n    }\n  }\n});\n```\n\nThis pattern applies to any chrome API that manages exclusive resources:\n`chrome.tabCapture`, `chrome.desktopCapture`, `chrome.offscreen.createDocument` (only one\noffscreen document allowed at a time). See `references\u002Fextensions\u002Fmedia-capture.md`.\n\n#### 17. `chrome.desktopCapture` requires a target tab with URL access\n\nWhen calling `chrome.desktopCapture.chooseDesktopMedia()` from a service worker, you must pass\nthe active tab as the `targetTab` parameter. The tab object must have its `url` field populated,\nwhich requires the `\"tabs\"` permission.\n\n```js\n\u002F\u002F ❌ BROKEN — called without targetTab from service worker\nchrome.desktopCapture.chooseDesktopMedia(['screen', 'window'], (streamId) => { ... });\n\u002F\u002F Error: \"A target tab is required when called from a service worker context.\"\n\n\u002F\u002F ❌ BROKEN — tab doesn't have url field (missing \"tabs\" permission)\nconst [tab] = await chrome.tabs.query({ active: true, currentWindow: true });\nchrome.desktopCapture.chooseDesktopMedia(['screen', 'window'], tab, (streamId) => { ... });\n\u002F\u002F Error: \"targetTab doesn't have URL field set.\"\n\n\u002F\u002F ✅ CORRECT — \"tabs\" permission in manifest + pass tab object\n\u002F\u002F manifest.json: { \"permissions\": [\"tabs\", \"desktopCapture\"] }\nconst [tab] = await chrome.tabs.query({ active: true, currentWindow: true });\nchrome.desktopCapture.chooseDesktopMedia(['screen', 'window'], tab, (streamId) => {\n  if (!streamId) return; \u002F\u002F User cancelled\n});\n```\n\n**Note:** Prefer `chrome.tabCapture.getMediaStreamId()` for tab-only recording. Use `chrome.desktopCapture` only when the user should choose which screen\u002Fwindow to capture. See `references\u002Fextensions\u002Fmedia-capture.md`.\n\n#### 18. `chrome.windows` has NO `.query()` method — use `getAll`, `getLastFocused`, or `getCurrent`\n\nUnlike `chrome.tabs.query()`, the `chrome.windows` API does NOT have a `.query()` method.\n\n```js\n\u002F\u002F ❌ BROKEN — chrome.windows.query does not exist\nconst windows = await chrome.windows.query({ focused: true });\n\u002F\u002F TypeError: chrome.windows.query is not a function\n\n\u002F\u002F ✅ CORRECT — use the right method for your need\nconst focused = await chrome.windows.getLastFocused({ populate: true });\nconst current = await chrome.windows.getCurrent({ populate: true });\nconst all     = await chrome.windows.getAll({ populate: true });\n```\n\n**`chrome.windows` methods:** `getAll`, `getLastFocused`, `getCurrent`, `get(windowId)`, `create`, `update`, `remove`. See `references\u002Fextensions\u002Ftab-management.md`.\n\n### Always Manifest V3\n\nNever generate Manifest V2 code.\n- `background.service_worker` not `background.scripts`\n- `chrome.action` not `chrome.browserAction`\n- `chrome.scripting.executeScript` not `chrome.tabs.executeScript`\n- `host_permissions` is separate from `permissions`\n- No inline scripts in HTML — use `\u003Cscript src=\"file.js\">`\n- No inline event handlers — use `addEventListener`\n\n---\n\n## Part 2 — Publishing to the Chrome Web Store\n\nManage `CHROMEWEBSTORE.md` — the single source of truth for all Chrome Web Store listing\nmetadata, permissions justifications, privacy disclosures, version history, and publishing\nreadiness for a Chrome extension project.\n\n### Core Workflow\n\nEvery time you touch a Chrome extension project in a way that affects its store presence,\nupdate (or create) `CHROMEWEBSTORE.md` in the project root. The file tracks everything the\ndeveloper needs to fill out in the Chrome Developer Dashboard, so they can copy-paste from\na single doc instead of scrambling at publish time.\n\n#### When to create CHROMEWEBSTORE.md\n\nCreate it the moment any of these happen:\n- The user says they want to publish an extension\n- The user asks to \"prepare for the store\" or \"get ready to publish\"\n- You're building a new extension that will clearly end up on the store\n- The user asks about store listing requirements\n\nUse the template in `references\u002Fwebstore\u002Fchromewebstore-template.md` as your starting point. Read it\nbefore generating the file.\n\n#### When to update CHROMEWEBSTORE.md\n\nUpdate it whenever:\n- **User-facing changes**: Bump the \"Last Updated\" date, update the feature list in\n  descriptions, and add an entry to Version History\n- **manifest.json changes**: If permissions, host_permissions, or content_scripts changed,\n  update the Permissions Justification section — every permission needs a plain-English\n  reason the review team can understand\n- **New release**: Add a Version History entry with version number, date, and summary\n- **Privacy-relevant changes**: If data collection, storage, or transmission changed,\n  update the Privacy & Data Use section and the privacy policy\n- **Asset changes**: If icons or UI changed, note which screenshots need refreshing\n- **Rejection response**: If the user reports a CWS rejection, update the file with the\n  fix and add a note to Version History\n\n#### How to fill it out\n\nFor each section, pull information from the actual project files:\n1. Read `manifest.json` to extract name, version, description, permissions, host_permissions\n2. Scan the codebase for data collection (storage, fetch calls, analytics)\n3. Check for icon files and their dimensions\n4. Look at the extension's UI to understand features for the description\n\nWrite store-facing copy in a tone that is specific, honest, and benefit-oriented. The Chrome\nWeb Store review team rejects vague descriptions. \"Makes your life easier\" will be rejected.\n\"Highlights search results on any webpage and lets you save highlights to a local list\" will\npass.\n\n### CHROMEWEBSTORE.md Sections\n\nRead `references\u002Fwebstore\u002Fchromewebstore-template.md` before generating the file — it defines\nwhat each section covers and how to fill it out. The highest-risk section is Permissions\nJustification: write a specific plain-English reason per permission and per host_permission.\n\"Needed for the extension to work\" will be rejected. Read `references\u002Fwebstore\u002Fprivacy-policy.md`\nfor guidance on generating a privacy policy.\n\n### Pre-Publish Checklist\n\nBefore submission, run through `references\u002Fwebstore\u002Freview-checklist.md`. The most common\nfirst-submission failures:\n- Every permission and host_permission must have a specific justification (not \"needed to work\")\n- Privacy policy URL must be live and match the data use disclosure form\n- At least 1 screenshot at 1280×800 or 640×400\n- ZIP must exclude `.git\u002F`, `node_modules\u002F`, `.env`, `CHROMEWEBSTORE.md`\n\n### Store Listing Copy Guidelines\n\nFor copy guidelines and common rejection reasons, see `references\u002Fwebstore\u002Fstore-listing.md`.\nKey rule: lead with function (\"Highlights search terms on any webpage\"), not feeling (\"Enjoy\nsearching again\").\n\n---\n\n## Reference Files\n\nFor detailed API patterns and publishing guidance, read the relevant file BEFORE writing code or content:\n\n| Topic | Reference |\n|-------|-----------|\n| Side panels | `references\u002Fextensions\u002Fside-panel.md` |\n| Content scripts & DOM | `references\u002Fextensions\u002Fcontent-scripts.md` |\n| Popups | `references\u002Fextensions\u002Fpopup-ui.md` |\n| Service worker lifetime | `references\u002Fextensions\u002Fservice-worker.md` |\n| Code execution & CSP | `references\u002Fextensions\u002Fcsp-sandbox.md` |\n| API calls | `references\u002Fextensions\u002Fapi-calling.md` |\n| Declarative Net Request | `references\u002Fextensions\u002Fdeclarative-net-request.md` |\n| Chrome Prompt API | `references\u002Fextensions\u002Fprompt-api.md` |\n| DevTools panels | `references\u002Fextensions\u002Fdevtools.md` |\n| Authentication | `references\u002Fextensions\u002Fauth-identity.md` |\n| Context menus | `references\u002Fextensions\u002Fcontext-menus.md` |\n| Omnibox | `references\u002Fextensions\u002Fomnibox.md` |\n| Storage | `references\u002Fextensions\u002Fstorage.md` |\n| Tab & window management | `references\u002Fextensions\u002Ftab-management.md` |\n| Tab\u002Fdesktop capture | `references\u002Fextensions\u002Fmedia-capture.md` |\n| Message passing | `references\u002Fextensions\u002Fmessage-passing.md` |\n| Icons | `references\u002Fextensions\u002Ficons.md` |\n| CHROMEWEBSTORE.md template | `references\u002Fwebstore\u002Fchromewebstore-template.md` |\n| Privacy policy guidance | `references\u002Fwebstore\u002Fprivacy-policy.md` |\n| Pre-publish review checklist | `references\u002Fwebstore\u002Freview-checklist.md` |\n| Store listing tips & rejections | `references\u002Fwebstore\u002Fstore-listing.md` |\n\n## Output Checklist\n\nVerify EVERY item before delivering:\n\n- [ ] `manifest_version: 3` — no V2 APIs anywhere\n- [ ] All icon files referenced in manifest exist as real files with correct dimensions — or icons are omitted\n- [ ] Side panel has an explicit open trigger (not just a manifest declaration)\n- [ ] Code execution uses sandbox\u002Fblob\u002Fsrcdoc — no `eval()` in extension pages\n- [ ] `tabs` permission declared if `tab.url` or `tab.title` is accessed\n- [ ] All code uses `async`\u002F`await` — no `.then()` chains\n- [ ] Content scripts batch DOM updates with `requestAnimationFrame`\n- [ ] Service worker stores NO state in global variables — uses `chrome.storage`\n- [ ] No inline scripts or event handlers in HTML\n- [ ] Context menu actions show user confirmation\n- [ ] `\"action\": {}` (or more) present in manifest if using `chrome.action.*` APIs\n- [ ] If reading\u002Fscripting tabs from a side panel: use `tabs` + `host_permissions` (NOT `activeTab`)\n- [ ] DevTools panel paths in `chrome.devtools.panels.create()` are relative to extension root\n- [ ] Offscreen documents use ONLY `chrome.runtime` messaging — no `chrome.downloads`, `chrome.action`, etc.\n- [ ] All image refs in `chrome.notifications`, `chrome.action.setIcon`, etc. point to real files (or use data URLs)\n- [ ] Tab\u002Fdesktop capture uses state locking to prevent double-start errors\n- [ ] `chrome.desktopCapture.chooseDesktopMedia` passes `targetTab` with `tabs` permission\n- [ ] `chrome.windows` calls use `getAll`\u002F`getLastFocused`\u002F`getCurrent` — NOT `.query()` (it doesn't exist)\n- [ ] `sidePanel.setPanelBehavior` uses `openPanelOnActionClick` — NOT `openPanelOnActionIconClick`\n- [ ] Error handling on all async operations\n- [ ] `host_permissions` scoped to specific domains (not `\u003Call_urls>` unless needed)\n- [ ] `return true` in `onMessage` listeners with async responses\n",{"name":5,"description":7},"main","900ea3c9eb045fd5b0317dc1103777ecf3ea4aeb","skills\u002Fchrome-extensions",0,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker","https:\u002F\u002Fnguyenhungtran18.github.io\u002Fskill-and-tool-tracker\u002F","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18","2026-08-31 18:36:09",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add nguyenhungtran18\u002Fskill-and-tool-tracker --skill chrome-extensions",{"tool":37,"command":38},"bunx","bunx skills add nguyenhungtran18\u002Fskill-and-tool-tracker --skill chrome-extensions",{"tool":40,"command":41},"pnpm","pnpm dlx skills add nguyenhungtran18\u002Fskill-and-tool-tracker --skill chrome-extensions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002FSKILL.md",true,[45,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"references\u002Fextensions\u002Fapi-calling.md","REFERENCE","参考文档",2188,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fapi-calling.md",{"path":52,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":53,"sourceHtmlUrl":54},"references\u002Fextensions\u002Fauth-identity.md",4036,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fauth-identity.md",{"path":56,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":57,"sourceHtmlUrl":58},"references\u002Fextensions\u002Fcontent-scripts.md",3506,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fcontent-scripts.md",{"path":60,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":61,"sourceHtmlUrl":62},"references\u002Fextensions\u002Fcontext-menus.md",1529,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fcontext-menus.md",{"path":64,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fextensions\u002Fcsp-sandbox.md",4810,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fcsp-sandbox.md",{"path":68,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Fextensions\u002Fdeclarative-net-request.md",2794,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fdeclarative-net-request.md",{"path":72,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fextensions\u002Fdevtools.md",2889,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fdevtools.md",{"path":76,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fextensions\u002Ficons.md",2756,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Ficons.md",{"path":80,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":81,"sourceHtmlUrl":82},"references\u002Fextensions\u002Fmedia-capture.md",4805,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fmedia-capture.md",{"path":84,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":85,"sourceHtmlUrl":86},"references\u002Fextensions\u002Fmessage-passing.md",4214,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fmessage-passing.md",{"path":88,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":89,"sourceHtmlUrl":90},"references\u002Fextensions\u002Fomnibox.md",1819,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fomnibox.md",{"path":92,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":93,"sourceHtmlUrl":94},"references\u002Fextensions\u002Fpopup-ui.md",2378,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fpopup-ui.md",{"path":96,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":97,"sourceHtmlUrl":98},"references\u002Fextensions\u002Fprompt-api.md",3835,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fprompt-api.md",{"path":100,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":101,"sourceHtmlUrl":102},"references\u002Fextensions\u002Fservice-worker.md",4591,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fservice-worker.md",{"path":104,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":105,"sourceHtmlUrl":106},"references\u002Fextensions\u002Fside-panel.md",4480,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fside-panel.md",{"path":108,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":109,"sourceHtmlUrl":110},"references\u002Fextensions\u002Fstorage.md",1965,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Fstorage.md",{"path":112,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":113,"sourceHtmlUrl":114},"references\u002Fextensions\u002Ftab-management.md",3756,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fextensions\u002Ftab-management.md",{"path":116,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":117,"sourceHtmlUrl":118},"references\u002Fwebstore\u002Fchromewebstore-template.md",5356,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fwebstore\u002Fchromewebstore-template.md",{"path":120,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":121,"sourceHtmlUrl":122},"references\u002Fwebstore\u002Fprivacy-policy.md",4247,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fwebstore\u002Fprivacy-policy.md",{"path":124,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":125,"sourceHtmlUrl":126},"references\u002Fwebstore\u002Freview-checklist.md",7074,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fwebstore\u002Freview-checklist.md",{"path":128,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":129,"sourceHtmlUrl":130},"references\u002Fwebstore\u002Fstore-listing.md",6739,"https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fchrome-extensions\u002Freferences\u002Fwebstore\u002Fstore-listing.md",[132,139,146,153,160,167],{"skillNo":133,"name":134,"nameZh":6,"description":135,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":136,"categories":137,"keywords":138,"publishedAt":18},"01M7BVP4P83TK60JZ4P8RP9VP7","xcode-project-setup","Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fxcode_project_setup\u002FSKILL.md",[],[],{"skillNo":140,"name":141,"nameZh":6,"description":142,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":143,"categories":144,"keywords":145,"publishedAt":18},"01M7BVP01K4CSJJ8G90FT8S2D5","writing-skills","Use when creating new skills, editing existing skills, or verifying skills work before deployment","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":18},"01M7BVNY22GXD871GYTSH599F1","writing-plans","Use when you have a spec or requirements for a multi-step task, before touching code","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-plans\u002FSKILL.md",[],[],{"skillNo":154,"name":155,"nameZh":6,"description":156,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":157,"categories":158,"keywords":159,"publishedAt":18},"01M7BVNQWF24RNKA8A4KM2HJ3T","workflow-skill-creator","Distills a completed user workflow or interaction into a reusable agent skill. Use when the user asks to turn their workflow, interaction, or multi-step process into a skill, or when they say \"make this a skill\", \"create a skill from what we just did\", \"package this workflow\" or similar. Do not use for creating skills from scratch without an existing workflow (use a generic skill-creator for that).","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fworkflow_skill_creator\u002FSKILL.md",[],[],{"skillNo":161,"name":162,"nameZh":6,"description":163,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":164,"categories":165,"keywords":166,"publishedAt":18},"01M7BVNNY67XPCQAQHY3FBKDGC","verify-and-stop","Prove existing work meets acceptance conditions without expanding scope. Use for validation-only tasks, completion checks, focused gate runs, and last-mile proof.","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fverify-and-stop\u002FSKILL.md",[],[],{"skillNo":168,"name":169,"nameZh":6,"description":170,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":171,"categories":172,"keywords":173,"publishedAt":18},"01M7BVNKB4Z7SZT85B73ZZ90Y6","verification-before-completion","Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always","https:\u002F\u002Fgithub.com\u002Fnguyenhungtran18\u002Fskill-and-tool-tracker\u002Fblob\u002Fmain\u002Fskills\u002Fverification-before-completion\u002FSKILL.md",[],[]]