AI Agent Hub
Back to skills
💻

Browser Extension Builder

Development Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Please follow https://skillhub.cn/install/skillhub.md to install @org-02qudk26/browser-extension-builder.

About this skill

Problem it solves

Browser extension work often fails around practical engineering details: manifest.json permissions are too broad and trigger store friction; content scripts and background service workers blur responsibilities; fragile page selectors break quietly; user settings and state lack durable storage. This skill turns those constraints into a concrete architecture guide for building stable popup, content, background, and options surfaces.

How it works

It follows Manifest V3 (MV3) and maps a typical project layout: popup/ for interactive UI, content/content.js for page injection, background/service-worker.js for lifecycle-aware background logic, and options/ for configuration. It recommends durable state with chrome.storage.local or chrome.storage.sync, and wraps get and set in Promises so async reads and writes are easier to reason about. It also clarifies how permissions, content_scripts, and action relate: use activeTab only when the extension needs the current tab, introduce broader permissions only for cross-tab data, and keep the store publishing path in view. It calls out anti-patterns: avoid requesting every permission, avoid heavy blocking work in the worker, and avoid brittle selectors. Better defaults are optional permissions, alarms for scheduled tasks, stable selectors, and explicit error handling. Scope note: it targets browser extension architecture, not a full product backend, and cross-browser differences or store policies still need validation for your target platforms.

Use Cases

  • When starting a new extension, split it into popup, content, background, and options under MV3 and scope manifest permissions.
  • When content scripts inject page UI, keep content.js selectors, styles, and error handling together.
  • When saving settings, persist state with chrome.storage and wrap get/set for popup and options sharing.
  • Before publishing, audit MV3 patterns: avoid long background tasks and narrow permissions to activeTab or optional permissions.

Best For

  • Independent Chrome extension developers who need a clean MV3 layout, popup/content entry points, and narrower permissions for store review.
  • Engineers maintaining internal browser tools who need shared chrome.storage state across options, content scripts, and background workers.
  • Developers responsible for app-store listing who need to audit manifest, heavy background work, and selector breakage before release.
  • Cross-browser extension developers who need a reusable extension structure and clear content/background boundaries.