[AUTO-002] Remove dead content.js and unused Formatter.postToWebhook #2

Closed
opened 2026-07-13 10:44:31 +00:00 by frank · 1 comment
Owner

Task ID: AUTO-002
Priority: P2
Status: TODO


Priority: P2
Status: TODO

Goal: Delete dead code identified in the 2026-07-10 code health pass.
Why it matters: content.js's CAPTURE_CONTEXT listener is never sent by anything — background.js and popup.js both use inline chrome.scripting.executeScript instead — yet content.js still gets injected into every page (matches: ["<all_urls>"]) for no purpose. Formatter.postToWebhook (formatter.js:50-65) is also defined but never called; background.js's handleSend reimplements the same logic inline.
Scope: Remove content.js and its manifest.json content_script registration if confirmed unused; either delete Formatter.postToWebhook or refactor handleSend to call it instead of duplicating fetch/response-check logic.
Expected files or areas: content.js, manifest.json, formatter.js, background.js.
Acceptance criteria: No behavior change for any existing send flow (text selection, link, image); one fewer unnecessary content-script injection; no duplicated webhook-post logic.
Validation: node --check on touched files; manually exercise each send type in a loaded extension to confirm no regression.
Risks or assumptions: Assumes content.js truly has no other consumer — re-grep for CAPTURE_CONTEXT before deleting to be sure.
Notes: None.

Synced from .ai/AUTONOMOUS_PLAN.md by forge sync.

**Task ID:** AUTO-002 **Priority:** P2 **Status:** TODO --- Priority: P2 Status: TODO Goal: Delete dead code identified in the 2026-07-10 code health pass. Why it matters: `content.js`'s `CAPTURE_CONTEXT` listener is never sent by anything — background.js and popup.js both use inline `chrome.scripting.executeScript` instead — yet content.js still gets injected into every page (`matches: ["<all_urls>"]`) for no purpose. `Formatter.postToWebhook` (formatter.js:50-65) is also defined but never called; background.js's `handleSend` reimplements the same logic inline. Scope: Remove content.js and its manifest.json content_script registration if confirmed unused; either delete `Formatter.postToWebhook` or refactor `handleSend` to call it instead of duplicating fetch/response-check logic. Expected files or areas: content.js, manifest.json, formatter.js, background.js. Acceptance criteria: No behavior change for any existing send flow (text selection, link, image); one fewer unnecessary content-script injection; no duplicated webhook-post logic. Validation: `node --check` on touched files; manually exercise each send type in a loaded extension to confirm no regression. Risks or assumptions: Assumes content.js truly has no other consumer — re-grep for `CAPTURE_CONTEXT` before deleting to be sure. Notes: None. *Synced from `.ai/AUTONOMOUS_PLAN.md` by `forge sync`.*
frank added this to the Roadmap v1 milestone 2026-07-13 10:44:31 +00:00
frank closed this issue 2026-07-13 20:19:12 +00:00
Author
Owner

Closed by forge sync — task status changed to DONE.

Closed by `forge sync` — task status changed to DONE.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
frank/discord-share-extension#2
No description provided.