Skip to content

About

Local bilingual webpage translation for the Codex built-in browser. Toolbar and context menu, original/bilingual/translation-only modes. Codex 内置浏览器本地双语翻译扩展。

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Codex Browser Translator

Unresolved restart limitation: In the reported Windows Codex environment, restarting Codex resets the unpacked extension's loaded state: it may disappear and require you to load the same complete directory again. There is currently no verified fix, and formal 1.0 acceptance is blocked. One saved preference survived a restart and reload; other preferences and site permissions have not been verified, so this does not establish that all settings are lost. Dragging a CRX into the extension manager previously caused the entire app to exit; do not use that installation route. The workaround needs no system or Codex startup changes.

简体中文 · Installation · 1.0 validation · Releases

Local webpage translation for the Codex in-app browser. Start from the extension toolbar or right-click menu. Read paragraph-by-paragraph bilingual text, switch to translation only, or restore the original page. No API key, agent prompt, CDP connection, Node.js, or local server is needed for ordinary use.

1.0.0-rc.4 is a release candidate, not a completed 1.0 release. Native translation, automatic English selection and expanded GitHub menus have worked in observed checks; this does not prove AI detector model recovery. See the acceptance ledger and restart investigation.

Install or upgrade

  1. Download the 1.0.0-rc.4 candidate ZIP and extract it completely. Alternatively, use the complete extension/ directory from the candidate checkout, including runtime/.
  2. In Codex, open Settings → Browser → Extensions (or the browser extension menu → Manage extensions).
  3. Enable the extension manager's Developer mode, select Load unpacked, and choose the directory containing manifest.json.
  4. Open an ordinary HTTPS webpage. Click 网页翻译 in the toolbar or 双语翻译此页 in the page context menu.
  5. If the browser requests a page gesture, click 点击继续 in the translation panel. The browser may download local models on first use.

Keep the extracted folder. To upgrade from 0.3.0 at the same path, replace the complete extension files, reload the extension in its manager, then refresh previously opened webpages. The candidate adds settings storage and optional, per-site access; it does not automatically enable any site. Loading an unpacked extension does not require “Enable full CDP access.” Detailed guide and troubleshooting.

If the extension disappears after a Codex restart, load the same complete directory again and refresh the webpage. This is a temporary workaround, not a persistence fix. In a user-run check, the saved Article only scope survived the restart and same-directory reload. Other preferences and site permissions remain unverified.

Read webpages

Control Behavior
整页 / 仅正文 Translate the loaded readable page, including navigation and sidebars, or restrict extraction to the article
Source / target language Automatic source detection with manual correction; Simplified Chinese is the default target
双语 Paragraph translations next to the original; compact controls use translated labels with original-text hints
译文 Reversible changes to original text nodes, preserving original links, controls and inline code
原文 Pause translation and show original text; keep results for switching back
关闭并恢复 Cancel, restore and close; pause this tab's current site across refresh until manually restarted or the tab closes
Settings Save defaults, explicitly enable automatic translation for a site, or revoke it

The queue processes content incrementally, supports retry, and rejects stale results after source or route changes. Progress describes recognized candidates, not a promise that every character on a website was found. Protected input values, editors, code and identifiers are not translated. Same-origin frames and open Shadow DOM are handled when accessible.

Structured translation is validated before applying. If the native engine changes the structure markers, the extension falls back to translating individual text slots. This can reduce sentence fluency, but keeps original links and code usable. Bilingual translated links preserve navigation attributes; they do not duplicate a website's custom JavaScript listeners. Original links keep their behavior.

Automatic source language and dynamic content

Automatic source selection first tries the browser extension's local i18n detector. It can then use an already-ready native LanguageDetector, or a valid element/page language declaration. The panel identifies the source of that decision; declared language is not presented as successful model detection. Short menu labels inherit their region/page context. Unknown or low-confidence content without a usable declaration asks for manual correction instead of guessing English.

Starting translation processes consecutive chunks automatically. Opening menus, disclosure sections or popovers and inserting dynamic content triggers incremental discovery. Hidden content remains untouched until shown; pause, original mode and errors prevent automatic restarts. Large workloads still have an explicit continuation budget.

PDF translation remains disabled in rc.4. Its UI, context menus, routing and bundled PDF.js assets are excluded from the extension. The previous experiment is retained under experimental/ for future development, and is outside the current 1.0 acceptance scope.

Automatic translation of an expanded GitHub menu

Developer verification on a real GitHub page: automatic mode used the page language declaration and native translation, then translated newly opened menu items. Restore was checked separately. This does not establish the installed extension's i18n detector availability.

Local processing and permissions

Translation uses the browser's native Translator API; source selection uses local chrome.i18n.detectLanguage, an available LanguageDetector, and explicit page language metadata. There is no project-operated translation endpoint, API key, telemetry, or persisted document history. Browser-managed model downloads require network access. Availability depends on the host, language pair and model readiness.

  • Required permissions: activeTab, scripting, contextMenus, and storage.
  • storage.local stores preferences and site rules; storage.session stores per-tab pauses. Text and files are not written there.
  • HTTP(S) host access is optional and requested for a specific origin and port when enabling site automation . No site is authorized at install time.
  • Closing a page is separate from disabling site automation. Remove site access from settings when it is no longer wanted.

Compatibility and known boundaries

Windows Codex is the primary acceptance environment. Chromium alone does not guarantee native translation or language detection. The candidate's tests, real-browser observations and pending host checks are recorded separately in validation.

The current context may report downloadable without a usable instance; availability alone does not prove the model's download state. Use the built-in capability checker and actual creation/progress results. Operations can be cancelled and time out instead of waiting forever. Choosing a source language manually allows an already available translation pair to work independently of the detector.

Browser-internal pages, cross-origin/sandbox-blocked frames, closed Shadow DOM, image/canvas text and PDF documents are outside 1.0's scope. Site frameworks can replace DOM nodes; changed units are invalidated instead of receiving an old translation. Other operating systems and screen-reader behavior require their own acceptance evidence.

The candidate skips individual webpage structural units longer than 12,000 characters to preserve links and code. This is an explicit skip, not resumable work; the limit still needs evaluation against the formal 1.0 long-document requirements. Newly opened regions are discovered incrementally. User-paused sessions stay paused; reaching the work budget requires continuation. Real-site coverage remains under validation.

Development and contributing

Use Node.js 22.13+. Run npm ci --ignore-scripts, npm run build, npm run check, and npm test. npm run package:release creates an extension-only ZIP plus SHA-256 checksum; npm run verify:release checks its contents. The developer fixture at port 4173 is optional and is not a product dependency. Architecture · Changelog.

If this project helps you read and work inside Codex, a GitHub Star helps other users discover it. Issues, reproducible public examples and contributions are welcome. Please include host/extension versions, language pair, scope and the panel error; do not share private documents, credentials or browsing data. Contribution guide.

MIT licensed. The archived PDF experiment retains its upstream licenses. This is an independent community project, not an official OpenAI product.

About

Local bilingual webpage translation for the Codex built-in browser. Toolbar and context menu, original/bilingual/translation-only modes. Codex 内置浏览器本地双语翻译扩展。

Topics

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages