Chrome Extension Messaging Patterns
Implements robust inter-component communication patterns for Chrome Extensions, including message passing, ports, and state synchronization.
This skill provides a comprehensive framework for managing complex data flows between isolated Chrome Extension components. It covers communication between background service workers, content scripts, popups, and the side panel, offering standardized patterns for both one-time messages and long-lived port connections. By providing implementation-ready code for state synchronization and relaying messages, it helps developers avoid common pitfalls like context invalidation and unhandled asynchronous responses.
主な機能
01Background relay implementations for content script to side panel communication
02Structured, type-safe messaging protocols to prevent magic string errors
03Advanced error handling for invalidated contexts and connection retries
04One-time and long-lived messaging patterns between all extension components
05Centralized state management using chrome.storage synchronization
060 GitHub stars
ユースケース
01Synchronizing UI state between a popup and a side panel via a background script
02Handling external requests from web pages to the extension background worker
03Building data-heavy extensions that require streaming data through long-lived ports