moai-platform-chrome-extension

Implements Chrome Extension Manifest V3 development covering service workers, content scripts, messaging, and Web Store publishing.

2|Updated May 27, 2026
One-click install
npx skills add https://github.com/yekinya/moai-novel --skill moai-platform-chrome-extension-yekinya
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-platform-chrome-extension
Source: https://github.com/yekinya/moai-novel/tree/main/moai-novel/.claude/skills/moai-platform-chrome-extension
Command: npx skills add https://github.com/yekinya/moai-novel --skill moai-platform-chrome-extension-yekinya

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building Chrome extensions under Manifest V3 requires navigating a fundamentally changed architecture: persistent background pages are gone, remote code is banned, and blocking webRequest is replaced by declarativeNetRequest. This Skill provides the complete implementation knowledge to build, secure, debug, and publish MV3 extensions without hunting through scattered documentation. ## Core Features & Use Cases - Manifest V3 Architecture Guidance: Covers service worker lifecycle, event-driven patterns, chrome.storage state management, and offscreen documents for DOM access. - Component Communication Patterns: Implements one-time messages, long-lived port connections, cross-extension messaging, and web page to extension communication with origin validation. - Security and Publishing Workflow: Enforces CSP configuration, minimal permission strategies, and walks through Chrome Web Store submission, review, staged rollouts, and self-hosted distribution. - Use Case: When migrating an MV2 extension, use this Skill to convert background pages to service workers, replace blocking webRequest with declarativeNetRequest rules, and update the manifest to pass Web Store review. ## Quick Start Ask the AI to scaffold a Manifest V3 Chrome extension with a service worker, a content script for a specific site, and a popup UI.

Frequently Asked Questions about moai-platform-chrome-extension

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

FAQPage Schema
How do I migrate a Chrome extension from Manifest V2 to V3?

Replace background.scripts with a single background.service_worker string, convert persistent state to chrome.storage, replace blocking webRequest with declarativeNetRequest rules, and move host patterns from permissions to host_permissions. Bundle all JavaScript locally since remote code is prohibited.

How do content scripts communicate with the service worker?

Content scripts use chrome.runtime.sendMessage for one-time requests and chrome.runtime.connect for long-lived port connections. The service worker listens via chrome.runtime.onMessage and must return true or a Promise for async responses.

Why does my Manifest V3 service worker lose its state?

Service workers are event-driven and terminate when idle, so global variables are destroyed. Persist state using chrome.storage.local or chrome.storage.session, and use chrome.alarms instead of setTimeout for scheduled tasks.

What permissions does a Chrome extension need for script injection?

Programmatic injection with chrome.scripting.executeScript requires the scripting permission plus either host_permissions for the target URL or the activeTab permission granted by a user gesture. Prefer activeTab to minimize install-time warnings.

Why was my Chrome Web Store submission rejected?

Common rejection reasons include insufficient privacy policy, unjustified broad permissions like <all_urls>, vague permission justifications, and code quality issues. Provide specific justifications for each permission and declare accurate data practices in the dashboard.