extension-troubleshooting
Skill10 starsChanged 2 months agoApache-2.0View on GitHub
Diagnose Chrome-extension-side problems — MV3 service worker suspension and 5s bridge reconnection, unreachable content scripts, reload_extension, ON/OFF DOM comparison, and unpacked loading via chrome-extension://.
In this repository16 other files it gives its agents.
- browser-forensicsSkill
- browser-interactionSkill
- browser-state-recoverySkill
- dom-inspectionSkill
- dom-mutationSkill
- dom-targetingSkill
- human-like-interactionSkill
- mcp-troubleshootingSkill
- page-annotationSkill
- project-captureSkill
- project-reconstructionSkill
- regression-testingSkill
- selector-recoverySkill
- tab-managementSkill
- viewport-testingSkill
- visual-dom-comparisonSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 27
After rebuilding the extension: reload_extension {extensionId} — dispatches RELOAD_EXTENSION.
- Very specific: line 34
When the extension must stay off after a failed comparison: set_extension_enabled {extensionId, enabled: true} to restore it — never leave …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Skill: Extension Troubleshooting
PURPOSE
Fix the browser side of the bridge: the Manifest V3 extension whose service worker can be suspended at any time, the content scripts that must be injected per-page, and the question of whether the extension itself is polluting a page.
WHEN TO USE
- Bridge health says
connectedBrowsers: 0but Chrome is open. - Tools intermittently fail with "No active browser extension connected" then recover (classic service-worker suspension).
- Content-script-dependent tools fail on specific pages only.
- You must prove the extension does/doesn't inject artifacts into a page (ON/OFF comparison).
PREREQUISITES
- The unpacked extension loaded:
chrome://extensions→ Developer mode → Load unpacked → select the project'schrome-extension/directory. Extension pages are then reachable atchrome-extension://<id>/…. - Project built (
npm run build/npm run build:extension) sochrome-extension/distmatches the sources you are editing. - Bridge running (
npm run bridge), health check available.
WORKFLOW
- Confirm the socket:
curl http://localhost:3847/health→connectedBrowsers. Zero while Chrome runs = the service worker is suspended or never connected. - Understand MV3 lifecycle: the background service worker connects to
ws://localhost:3847/extension, heartbeats every 15s; the bridge prunes sockets silent > 75s. When Chrome suspends the worker, a reconnect timer retries every 5 seconds — so transient unavailability self-heals; wait ~10s before acting. - Wake it deterministically: open any page (or the extension's popup / a
chrome-extension://<id>/…page) — activity revives the service worker and the reconnect lands within the 5s window. - After rebuilding the extension:
reload_extension {extensionId}— dispatches RELOAD_EXTENSION. In Node simulation it reportsreloaded: truewith the note "Simulated reload: extension state preserved"; for real reloads usechrome://extensions→ reload icon, then re-check health.list_extensions {}shows installed extensions and status (in simulation a deterministic set markedsimulated: true). - Content script unreachable on a page — check in order:
- the page matches the manifest's injectable hosts (chrome:// pages, the Web Store and other protected pages are never content-scriptable — report this honestly, don't retry);
- the extension was reloaded after the last build (stale content scripts still run the old code);
- the tab was reloaded after the extension reload (content scripts only inject on navigation).
Then
reload_tab {tabId, bypassCache: true}and retest withinspect_live_page.
- Prove injection impact:
compare_extension_states {extensionId, tabId, waitDurationMs?, ...paths}— disable → hard reload → capture clean DOM/screenshot → enable → reload → capture injected → reportdomSizeDifferenceCharsandinjectedMarkersDetected. See the visual-dom-comparison skill for the full contract. - When the extension must stay off after a failed comparison:
set_extension_enabled {extensionId, enabled: true}to restore it — never leave it disabled.
TOOLS
list_extensions, reload_extension, set_extension_enabled, toggle_extension, compare_extension_states, reload_tab, list_tabs, inspect_live_page, get_tab_console_logs
EXAMPLES
curl http://localhost:3847/health
tools/call list_extensions {}
tools/call reload_extension { "extensionId": "forensic-recorder@mcpdom" }
tools/call reload_tab { "tabId": 42, "bypassCache": true }
tools/call compare_extension_states { "extensionId": "forensic-recorder@mcpdom", "tabId": 42 }FAILURE MODES
- "No active browser extension connected" (intermittent) — MV3 worker suspension; the 5s reconnect timer heals it. If it persists > 30s, the bridge was restarted while Chrome was closed — reload the extension or open a page to trigger reconnect.
- Content script never injects — protected page (chrome://, store), host not matched by manifest, or stale build. Verify the three checks in the workflow; do not claim page access you don't have.
- EXTENSION_NOT_FOUND — extensionId typo or the extension was removed;
list_extensionsshows the real ids (simulation lists a fixed set withsimulated: true). - Old behavior after code changes — you rebuilt but did not reload the extension, or reloaded the extension but not the tab; both reloads are required.
- Socket pruning loop — heartbeats (15s) not arriving; usually the worker is repeatedly suspended on an idle machine; keep a page open or accept the 5s reconnect cadence.
simulated: truefrom extension tools — no browser attached; these tools fall back to deterministic Node-side state; connect the extension for real data.
VALIDATION
/healthshowsconnectedBrowsers ≥ 1AND stays ≥ 1 across two checks ~10s apart (socket stable, not flapping).inspect_live_pagereturns the real url/title of the intended tab (content script alive on that page).get_tab_console_logs {tabId, level: "error"}is clean of extension-origin errors after a reload.
RECOVERY
- Full reset sequence: rebuild (
npm run build:extension) → reload the extension inchrome://extensions→reload_tab {bypassCache: true}→ health check → retry the tool. - Bridge side suspect: restart
npm run bridgeFIRST (extension reconnects on its own timer) — restarting the extension is the slower lever. - Still zero sockets: remove and re-load the unpacked extension from
chrome-extension/, confirm the id inchrome://extensions, then verify via/health.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

