2.2 KiB
2.2 KiB
Implement Task 2 — Active Tab Capture Flow for the Project Thoth ChatGPT Capture Connector MVP.
Context:
- This is a Manifest V3 Chrome/Edge extension.
- Capture Connectors must only capture source material; they must not reason, call LLMs, generate metadata, or interact with the Project Thoth application yet.
- The MVP action is a browser toolbar button labeled “Save to Project Thoth.”
- The extension should use minimal permissions: activeTab, scripting, and downloads as needed later.
- This task focuses only on toolbar click → active tab lookup → script injection → service worker/content script message passing.
Architecture requirements:
- Use the Manifest V3 service worker as the orchestration point.
- On toolbar button click, get the currently active tab.
- Verify the current tab URL is ChatGPT:
- Inject or execute a content script using chrome.scripting.
- The content script should send a message back to the service worker with a placeholder capture payload.
- The service worker should receive and log the payload.
- Do not implement the real ChatGPT DOM extractor yet.
- Do not implement Markdown normalization yet.
- Do not implement downloads yet except leaving clear TODO boundaries.
- Keep ChatGPT-specific extraction isolated for the next task.
Expected placeholder payload:
{ sourcePlatform: "ChatGPT", title: document.title || "ChatGPT Conversation", url: window.location.href, capturedAt: new Date().toISOString(), messages: [] }
Files to update or create:
- manifest.json
- src/background.js
- src/chatgptExtractor.js if needed as a placeholder injected module
- README.md if local testing instructions need updating
Acceptance criteria:
- Extension loads locally in Chrome/Edge.
- Toolbar button click triggers the service worker.
- On a ChatGPT tab, the content script executes successfully.
- A placeholder capture payload is returned to the service worker.
- On a non-ChatGPT tab, the extension does not inject and logs or displays a simple error.
- No LLM calls.
- No Project Thoth application dependency.
- No vault writes.
Keep the implementation simple, readable, and modular so Task 3 can replace the placeholder with the real ChatGPT DOM extractor.