chrome-extension

Builds and reviews Chrome extensions with Manifest V3, service workers, and content scripts.

22|Updated Sep 10, 2026
One-click install
npx skills add https://github.com/Lynricsy/HyperSkills --skill chrome-extension-lynricsy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: chrome-extension
Source: https://github.com/Lynricsy/HyperSkills/tree/main/skills/chrome-extension
Command: npx skills add https://github.com/Lynricsy/HyperSkills --skill chrome-extension-lynricsy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Chrome extension bugs are notoriously silent: a service worker killed after 30 seconds, a listener registered too late, a content script orphaned after reload, or a store rejection for remotely hosted code. This Skill encodes the Manifest V3 rules, lifecycle limits, and store policies so extensions work correctly the first time. ## Core Features & Use Cases - Build and migrate extensions: Scaffold with WXT, write the manifest with minimal permissions, implement the service worker, content scripts, messaging, and storage correctly, or migrate a Manifest V2 codebase. - Review and debug: Walk 25 ordered core rules to find blocking defects, diagnose silent failures per context (worker, content script, popup), and harden permissions before submission. - Prepare for the Chrome Web Store: Eliminate remotely hosted code, write per-permission justifications, align privacy disclosures, and package a review-ready zip. - Use Case: Your extension's badge resets and listeners stop firing after idle time. The Skill identifies the 30-second worker termination, moves state to chrome.storage, registers listeners at the top level, and replaces setInterval with chrome.alarms. ## Quick Start Ask the AI to review your extension's manifest.json and service worker for Manifest V3 lifecycle and permission problems before store submission.

Frequently Asked Questions about chrome-extension

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

FAQPage Schema
How do I keep state in a Manifest V3 service worker?

Service worker module-scope state disappears when Chrome terminates the worker after 30 seconds of inactivity. Persist anything the user would notice losing in chrome.storage: session for hot state, local for user data, sync for preferences, and read it inside each event handler.

Why does my Chrome extension message listener return undefined?

An async onMessage listener returns a Promise, which is truthy but not the literal true Chrome requires to keep the channel open, so sendMessage resolves with undefined. Use a non-async listener that calls sendResponse in a .then() and returns literal true.

Can a content script access page JavaScript variables?

No, content scripts run in an isolated world where only the DOM is shared with the page. Either declare world: "MAIN" (losing all chrome.* APIs) or inject a small page-world bridge script via chrome.runtime.getURL() that posts values back with window.postMessage.

Why does my extension work unpacked but fail after store installation?

Unpacked builds skip the chrome.alarms 30-second minimum clamp, so a too-frequent alarm works in development but is refused once installed. Also check anything bound to the extension id, which differs between unpacked and published builds.

What gets a Chrome extension rejected from the Web Store?

Remotely hosted code such as a CDN script tag triggers a Blue Argon rejection, and a CSP relaxed past script-src 'self' 'wasm-unsafe-eval' fails at install. Broad host permissions without plain-language justifications and obfuscated code also drive rejections and longer review.

When should I use WXT versus a vanilla extension setup?

Use WXT when the project involves TypeScript, a framework UI, or cross-browser output; it provides entrypoint conventions, storage.defineItem migrations, and testing plugins. Keep raw files only for single-file experiments, and keep an existing Vite plus CRXJS setup rather than converting it.