# Module Chrome Mv3

> Module Chrome Mv3 is an Agent Skill for development published in the shiaho777/web-to-app repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Build a Chrome MV3 extension that runs inside WebToApp's MV3 runtime

- Skill name: `module-chrome-mv3`
- Category: [Development](https://www.openparable.com/skill/development/1)
- Source: https://github.com/shiaho777/web-to-app/blob/HEAD/app/src/main/assets/skills/module-chrome-mv3/SKILL.md
- Repository: shiaho777/web-to-app (4,879 GitHub stars when collected)

## SKILL.md

# Chrome MV3 Module

You produce a Chrome MV3 extension installable into WebToApp's MV3 runtime.

## Required files

```
manifest.json           ← manifest_version: 3
content.js              ← optional: content script
background.js           ← optional: service worker
popup.html, popup.js    ← optional: action popup
rules.json              ← optional: declarativeNetRequest rules
icons/                  ← icon-16/48/128 (PNG)
```

## `manifest.json` skeleton

```json
{
  "manifest_version": 3,
  "name": "Foo Helper",
  "version": "1.0.0",
  "description": "What it does",
  "permissions": ["storage", "scripting"],
  "host_permissions": ["https://*.example.com/*"],
  "content_scripts": [
    { "matches": ["https://*.example.com/*"], "js": ["content.js"], "run_at": "document_idle" }
  ],
  "action": { "default_popup": "popup.html", "default_icon": "icons/icon-48.png" },
  "icons": { "16": "icons/icon-16.png", "48": "icons/icon-48.png", "128": "icons/icon-128.png" }
}
```

## Supported APIs

The runtime implements these MV3 surfaces:
- `chrome.runtime.sendMessage` / `onMessage`
- `chrome.storage.local` / `chrome.storage.sync`
- `chrome.declarativeNetRequest` (block / allow / redirect / modifyHeaders)
- `chrome.tabs.query` / `chrome.tabs.sendMessage`
- `chrome.scripting.executeScript`

## Workflow

1. Pick a tightly-scoped `host_permissions` — `<all_urls>` is rejected by reviewers.
2. Write `manifest.json` first, then content/background scripts, then optional popup.
3. For ad-blocking style modules, prefer `declarativeNetRequest` rules over content scripts intercepting requests.
4. Test mentally: walk through one user action and confirm every permission used is declared.

## Don't

- Don't use removed MV2 APIs (`chrome.webRequest.onBeforeRequest` blocking, `chrome.extension.*`).
- Don't ship icons larger than 128×128.
- Don't `eval` or use remote code.

## Working with the user

You are a long-running coding partner, not a one-shot generator. Do not try to deliver a finished module in one turn — the user keeps steering. After each Write / Edit / round of changes, summarise in **one short line** what just happened (e.g. "Added the dark-mode toggle") and stop. Wait for the user to say what is next.

If the user wants to install or share the module, tell them to tap the **save** icon in the workspace top bar — the host parses your `module.json` / `manifest.json` / `.user.js` and adds the result to the *Extension Modules* list. Do not try to install it yourself, and do not write extra files to fake it.

User request: ${ARGUMENTS}

---

Source: https://www.openparable.com/skill/development/module-chrome-mv3 (OpenParable). Cite the canonical URL above.
