# Fabulous Summary

A Chrome extension for fast page understanding with OpenRouter models.

It includes:
- Popup settings for API key, model, language, system prompts, and summary modal size
- Floating content-script buttons for text summary and screenshot summary
- Side Panel chat with page context (`Live` and `Snapshot` modes)
- Shared multilingual settings (`zh` / `en`) via `zustand + chrome.storage.local`

## Features

- OpenRouter integration (`chat/completions`)
- Two summary modes on page:
  - Text mode (`innerText`)
  - Screenshot + text mode (`captureVisibleTab` + page text)
- Configurable summary modal sizes:
  - Small / Medium / Large / Fullscreen
- Side Panel page chat:
  - `Live`: reads active page context on every question
  - `Snapshot`: manually capture page context once and reuse
- Markdown rendering for summaries and chat replies
- Customizable system prompts in both Chinese and English
- Popup, Side Panel, and Content Script share the same language/settings

## Tech Stack

- React 19
- Vite + CRXJS (Manifest V3)
- Tailwind CSS v4 (Popup)
- Zustand (shared state)
- React Markdown

## Project Structure

- `src/popup/` popup settings UI
- `src/content/` floating buttons + summary modal + content message handlers
- `src/sidepanel/` chat UI based on page context
- `src/background/` OpenRouter requests + tab/screenshot/context bridge
- `src/shared/` i18n and global settings store
- `manifest.config.js` Chrome extension manifest source

## Quick Start

```bash
npm install
npm run dev
```

Then in Chrome:
1. Open `chrome://extensions/`
2. Enable `Developer mode`
3. Load unpacked extension from `dist/`

## Build

```bash
npm run build
```

Production output is generated in `dist/`.

Static landing page is zero-build now.
Upload `index.html`, `logo.png`, and `icon32.png` to your CDN directly.

## Configuration (Popup)

- `Language`: Chinese / English
- `OpenRouter API Key`
- `Preset model` + `Custom model`
- `System prompt` (separate default/editable prompts for zh/en)
- `Summary modal size` (Small/Medium/Large/Fullscreen)

## Permissions

Manifest includes:
- `storage`
- `activeTab`
- `sidePanel`
- `contentSettings`
- host permissions for `https://openrouter.ai/*` and page access (`<all_urls>`)

## Notes

- This extension sends page text and optional screenshot data to your selected OpenRouter model when you request summary/chat.
- Keep your API key private and rotate it if exposed.

## License

MIT
