A Chrome extension that translates entire web pages using the DeepSeek-chat model. Offers fast concurrent translation, persistent caching, and instant switching between original and translated text.
| Configuration Panel | Original English Page | Translated Chinese Page |
|---|---|---|
![]() |
![]() |
![]() |
- Full-page translation — translate all visible text content on any web page
- Concurrent requests — sends multiple API requests in parallel (configurable, default 6) for maximum speed
- Batch merging — merges text segments into larger batches (default 100 segments or 10,000 chars per batch) to reduce API calls
- Persistent cache — translations are cached in
chrome.storage.sessionand survive page refreshes - Instant toggle — switch between original text and translation instantly with cached data (no re-translation needed)
- Auto-restore — translated pages automatically show translation after refresh
- Configurable — API key, target language, concurrency, merge size, and more
- Convenient popup UI — one-click translate, language swap, and status feedback
- Open Chrome and go to
chrome://extensions/ - Enable Developer mode (toggle in top-right corner)
- Click Load unpacked
- Select the
deepseek-translatorfolder
- Click the extension icon in the toolbar, then click the Settings button (⚙️)
- Enter your DeepSeek API Key from platform.deepseek.com
- (Optional) Adjust translation settings — concurrency, merge size, default target language
- Click Save or Test API Connection to verify
- Navigate to any web page
- Click the extension icon → choose source/target language → click Translate Page
- A progress bar appears at the top of the page during translation
- After translation completes, click the extension icon again to see toggle buttons:
- 译文 (Translation) — switch to the translated content
- 原文 (Original) — switch back to the original content
- Switching is instant — no re-translation needed
Tip: Translated pages automatically restore their translation after refresh — no need to re-translate.
deepseek-translator/
├── manifest.json # Chrome Extension Manifest V3
├── background.js # Service Worker — API calls, concurrency control
├── content/
│ ├── content.js # Text extraction, caching, DOM manipulation
│ └── content.css # Progress banner styles
├── popup/
│ ├── popup.html # Popup UI
│ ├── popup.js # Popup logic — state sync, user interactions
│ └── popup.css # Popup styles
├── options/
│ ├── options.html # Settings page
│ ├── options.js # Settings logic, API test
│ └── options.css # Settings page styles
├── figs/ # Screenshots
│ ├── config.png
│ ├── ori_page.png
│ └── translated_zh.png
└── icons/
├── icon16.png
├── icon48.png
└── icon128.png
Popup clicks "Translate Page"
│
▼
Content Script (content.js)
├── Extracts visible text nodes from DOM
├── Merges text into batches (configurable size/char limit)
└── Sends all batches to Background Worker
│
▼
Background Worker (background.js)
├── Concurrently translates each batch via DeepSeek API
├── Returns all results at once
└── (Concurrency controlled by worker pool)
│
▼
Content Script (content.js)
├── Splits batch results back to per-segment translations
├── Writes to dual cache: memory (instant) + chrome.storage.session (persist)
└── Applies translations to DOM
│
┌──────┴──────┐
▼ ▼
[Original] [Translation] ← instant toggle via memory cache
│
▼
Page refresh → auto-restore from chrome.storage.session cache
| Layer | Storage | Latency | Purpose |
|---|---|---|---|
| Memory | In-memory JS variable | Zero | Same-session toggle between original/translation |
| Session | chrome.storage.session |
Async | Persist across page refreshes |
Each cached entry is keyed by trans:{origin}{pathname}:{targetLang}:{sourceLang}. Text nodes are identified by XPath + text-node index for reliable matching across DOM lifecycle.
| Setting | Default | Description |
|---|---|---|
| API Key | — | Your DeepSeek API key (get from platform.deepseek.com) |
| API URL | https://api.deepseek.com/v1/chat/completions |
API endpoint (change for proxy/mirror) |
| Model | deepseek-chat |
DeepSeek model to use |
| Target Language | Chinese | Default target language |
| Concurrency | 6 | Max concurrent API requests (3–8 recommended) |
| Batch Merge Size | 100 | Max text segments per API request |
| Batch Max Chars | 10,000 | Max characters per API request (overrides merge size) |
- Chrome browser (Manifest V3)
- DeepSeek API key with active credits
- All translation requests go directly from your browser to DeepSeek's API
- No third-party servers involved
- Only visible text content on the page is sent for translation
- Cached data is stored locally in
chrome.storage.session(browser memory, cleared when browser closes)
MIT


