Expert guidelines for Chrome extension development with Manifest V3, covering security, performance, and best practices
中文简介正在准备中。当前显示原文说明。
ScepticAgent internal architecture reference. Use whenever the user asks how the extension works, wants to add a new AI provider, add a new highlight category, debug communication between components, understand the agent loop or streaming, or work with provider routing and the Gemini CORS proxy.
中文简介正在准备中。当前显示原文说明。
查看安装方法安装前可以查看交给 AI 代理的指令内容。
Side Panel (app.js)
│ chrome.runtime.connect("agent") — one port per request
▼
Service Worker (background.js)
│ fetch() to provider API
▼
AI Provider (Anthropic / OpenAI / Gemini)
Two parallel port connections fire on page open via Promise.all:
streamViaPort("analyze") — full analysis with agent loopquickHighlightPage() — fast highlight scan| Message | Meaning |
|---|---|
{ type: "status", message } | Progress label shown in UI |
{ type: "tool_call", name, label } | Tool being invoked |
{ type: "text_delta", text } | Streamed text chunk |
{ type: "highlight_item", highlight, index } | One highlight, emitted in real-time |
{ type: "highlights_result", summary, categorySummaries } | Final highlights metadata |
{ type: "done" } | Stream complete |
{ type: "error", message } | Error — stops streaming |
runAgentLoop / runHighlightsAgentLoop — up to 12 iterations (4 for highlights).
Stop reasons:
end_turn → breakpause_turn → continue (server-side web_search still running)tool_use → run fetch_url, re-submit with resultsTools: web_search_20250305 (server-side, Anthropic-hosted), fetch_url (client-side, fetchUrl() in background.js).
parseAgentStream(response, port, onTextDelta?) reads the Anthropic SSE stream.
Optional onTextDelta callback intercepts text chunks — used by highlights to extract JSON objects in real-time via extractCompleteHighlights().
extractCompleteHighlights(buffer, fromPos) — brace-depth character scanner that finds complete {"phrase":...} JSON objects in a mid-stream buffer without waiting for the full response. Returns { highlights, nextPos }.
getProviderConfig() reads provider, ${p}Key, ${p}Model from chrome.storage.local.
"anthropic" → full agent loop with tools"openai" → runOpenAIStream — SSE streaming, no tools"gemini" → runGeminiStream + geminiProxyFetch — non-streaming, proxied through content scriptService workers send Origin: chrome-extension://[id] which Google's API rejects.
Fix: geminiProxyFetch() sends the request to the content script via chrome.tabs.sendMessage. The content script fetches from the page's http/https origin, which Google accepts.
Use Content-Type: text/plain + key as URL query param to avoid CORS preflight (simple request).
| Key | Description |
|---|---|
provider | "anthropic" / "openai" / "gemini" |
anthropicKey / openaiKey / geminiKey | API keys |
anthropicModel / openaiModel / geminiModel | Selected model |
apiKey | Legacy Anthropic key (still read for backwards compat) |
const XXX_API_BASE constant in background.jsgetProviderConfig() key/model mapsrunXxxStream(port, apiKey, model, systemText, messages, signal)handleAnalyze, handleChat, handleHighlightsoptions/index.html and logic to options/app.jshost_permissions in manifest.jsonCLAUDE.md and README.mdLABELS object and add .ra-hl-{category} CSS rule in content.jsCAT_META in sidepanel/app.js.scan-pill.{cat}, .hl-dot.{cat}, .hl-item-dot.{cat}, .summary-bullet-{cat} in sidepanel/style.csssidepanel/index.htmlbuildHighlightsPrompt() in background.jsCLAUDE.md and README.mdgenerateContent only), no tool use, no real URLs in source_urlhandleHighlightsSimple还没有评价。欢迎分享你的使用感受。
无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。
还没有评论。来写第一条吧。
Expert guidelines for Chrome extension development with Manifest V3, covering security, performance, and best practices
中文简介正在准备中。当前显示原文说明。
Use this skill when building applications with Gemini models, Gemini API, working with multimodal content (text, images, audio, video), implementing function calling, using structured outputs, or needing current model specifications. Covers SDK usage (google-genai for Python, @google/genai for JavaScript/TypeScript, com.google.genai:google-genai for Java, google.golang.org/genai for Go), model selection, and API capabilities.
中文简介正在准备中。当前显示原文说明。
ScepticAgent AI prompt reference. Use whenever the user asks about the prompts, wants to change analysis behaviour, modify what the AI looks for, adjust highlight categories or scoring, understand what instructions are sent to the AI, or tune the output format of analysis or highlights.
中文简介正在准备中。当前显示原文说明。
ScepticAgent packaging and Chrome Web Store publishing workflow. Use whenever the user wants to build the zip, package the extension, publish or submit to the Chrome Web Store, update the store listing, or deal with manifest/icon/permission requirements for publishing.
中文简介正在准备中。当前显示原文说明。
ScepticAgent UI and styles reference. Use whenever the user wants to change the side panel UI, modify highlight colours, update the markdown renderer, work with CSS architecture, add or change category colours, or understand how the sidepanel renders analysis output.
中文简介正在准备中。当前显示原文说明。
Searches multiple web sources, synthesizes findings, and produces cited research reports using delegated subagents. Use when the user asks to research a topic online, search the web, look something up, find current information, compare options, or produce a research report.
中文简介正在准备中。当前显示原文说明。