- WXT + React 18 + TypeScript setup - Background service worker (LLM API proxy) - Content script (floating toolbar + text selection) - Options page (provider/model/API key config) - Popup UI - Gitea Actions workflows (CI, preview, release) - Vitest unit tests + Playwright E2E setup - Supports: OpenAI, Anthropic, Groq, OpenRouter
21 lines
409 B
TypeScript
21 lines
409 B
TypeScript
// Mock Chrome extension APIs
|
|
global.chrome = {
|
|
storage: {
|
|
local: {
|
|
get: vi.fn((keys, cb) => cb({})),
|
|
set: vi.fn((data, cb) => cb && cb()),
|
|
},
|
|
sync: {
|
|
get: vi.fn((keys, cb) => cb({})),
|
|
set: vi.fn((data, cb) => cb && cb()),
|
|
},
|
|
},
|
|
runtime: {
|
|
sendMessage: vi.fn(),
|
|
onMessage: {
|
|
addListener: vi.fn(),
|
|
},
|
|
openOptionsPage: vi.fn(),
|
|
},
|
|
} as any;
|