Prompt file imported from VuongNQ/Movie-streaming (
.github/prompts/scaffold-extension-core.prompt.md). Fill in{{targetFolder}},{{fileFormat}},{{popupMode}},{{historyMax}},{{captureStrategy}}before use. Copyright stays with the author.
Scaffold Extension Core Files
Generate a minimal, working Chrome Extension (Manifest V3) scaffold for m3u8 link capture from the active tab network.
Inputs
- Target folder: {{targetFolder}}
- File format: {{fileFormat}}
- Popup mode default: {{popupMode}}
- History max size: {{historyMax}}
- Capture strategy: {{captureStrategy}}
Files to Generate
- manifest.json
- background/service-worker file
- popup HTML + popup script
- storage module for latest/history state
Required Behaviors
- Service worker captures m3u8 links only for the active tab in the current window.
- URL filtering must match
.m3u8in path or query, with optional content-type fallback. - Duplicate URLs are ignored.
- Popup shows current state and includes a
Copy linkaction with feedback. - Popup supports configurable mode:
- latest: show only latest link
- history: show capped latest-first list
- State survives service worker restart using extension storage.
Manifest and Permissions Rules
- Manifest must be MV3.
- Include only minimal required permissions.
- Scope host permissions narrowly.
- Keep debugger attach/detach lifecycle explicit.
Output Format
Return in this order:
- File tree
- Full content for each generated file
- Setup steps to load unpacked extension
- Quick verification checklist for capture and copy behavior
Guardrails
- Do not include cookie/header/body logging.
- Do not broaden monitoring beyond active-tab scope unless requested.
- If assumptions are needed, list them before code generation.