[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-82108":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":14,"stars7d":16,"stars30d":17,"stars90d":15,"forks30d":15,"starsTrendScore":13,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":22,"hasPages":20,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":36,"readmeContent":37,"aiSummary":38,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":39,"discoverSource":40},82108,"margin-read","withmargin\u002Fmargin-read","withmargin","Privacy-first bilingual webpage translation browser extension.","https:\u002F\u002Fmarginread.com\u002F",null,"TypeScript",25,3,1,0,2,4,1.81,"MIT License",false,"main",true,[24,25,26,27,28,29,30,31,32,33,34,35],"anthropic","bilingual","browser-extension","chrome-extension","chromium-extension","gemini","manifest-v3","open-source","openai","privacy-first","translation","typescript","2026-06-12 02:04:23","# Margin Read\n\nTranslations: [繁體中文](README.zh-TW.md) · [简体中文](README.zh-CN.md) · [日本語](README.ja.md) · [한국어](README.ko.md) · [Español](README.es.md) · [Français](README.fr.md) · [Deutsch](README.de.md)\n\nMargin Read is a privacy-first browser extension for bilingual webpage translation.\n\nPrivacy-first translation and notes, placed where reading happens.\n\nMargin keeps the original webpage text in place and inserts translated text below the matching source blocks, so readers can compare both versions without losing page context.\n\nRepository: https:\u002F\u002Fgithub.com\u002Fwithmargin\u002Fmargin-read\n\n## Status\n\nMargin is an early MVP for Chrome and Chromium browsers using Manifest V3.\n\nThe extension is usable for normal article pages, legacy text-heavy pages, and selected dynamic pages, but it is still under active development. Expect rough edges on highly interactive web apps, pages with unusual layout systems, and sites that aggressively rewrite their DOM.\n\n## Features\n\n- Translate the current webpage from the extension popup.\n- Preserve original text and insert translations below matching source blocks.\n- Detect readable text blocks such as paragraphs, headings, list items, and blockquotes.\n- Handle legacy `table`, `font`, and `br`-separated pages.\n- Avoid common non-reading areas such as navigation, forms, buttons, code blocks, hidden text, and page chrome.\n- Use user-configured provider endpoints and API keys.\n- Support OpenAI, Anthropic Claude, and Google Gemini provider adapters.\n- Support local OpenAI-compatible runtimes such as LM Studio, Ollama, and llama.cpp server.\n- Fetch provider model lists from the options page.\n- Choose integrated or highlighted translation display styles.\n- Optionally show a floating page button that starts translation only after the user clicks it.\n- Use session-only translation caching by default, with persistent and disabled cache options.\n- Show popup diagnostics for text detection, queue state, and provider errors.\n- Observe dynamically inserted content.\n- Optimize X timeline cards and longform article pages by targeting readable content and avoiding profile names, action counts, media, and controls.\n\nMargin does not include PDF translation, EPUB translation, subtitle translation, OCR, input box translation, cloud sync, accounts, social features, default telemetry, or an official paid translation quota system.\n\n## Beta Testing\n\nBeta testers can install Margin from the Chrome Web Store beta listing when\ninvited, from a GitHub Release ZIP, or from a local source build. See the\n[Beta Testing Guide](docs\u002FBETA_TESTING.md) for the full setup and feedback\nworkflow.\n\n## Install From Source\n\nFor local development, load Margin as an unpacked extension:\n\n```sh\ncorepack enable\npnpm install\npnpm build\n```\n\nThen:\n\n1. Open `chrome:\u002F\u002Fextensions`.\n2. Enable Developer mode.\n3. Select Load unpacked.\n4. Choose the generated `apps\u002Fextension\u002Fdist\u002F` directory.\n5. Open Margin options.\n6. Configure a provider, API key, model, target language, and cache behavior.\n7. Open a webpage and click Translate this page from the Margin popup.\n\n## Provider Setup\n\nNo API key is bundled with Margin. Users provide their own raw provider API key without a `Bearer` prefix.\n\nBuilt-in providers use default endpoints:\n\n```text\nOpenAI: https:\u002F\u002Fapi.openai.com\u002Fv1\u002Fchat\u002Fcompletions\nAnthropic Claude: https:\u002F\u002Fapi.anthropic.com\u002Fv1\u002Fmessages\nGoogle Gemini: https:\u002F\u002Fgenerativelanguage.googleapis.com\u002Fv1beta\u002Fmodels\n```\n\nThe endpoint field is shown only for OpenAI Compatible \u002F Local LLM setups, where the user is expected to choose or enter a local endpoint.\n\nThe Fetch models action reads available models from the selected provider:\n\n- OpenAI: `GET \u002Fv1\u002Fmodels`\n- Anthropic Claude: `GET \u002Fv1\u002Fmodels`\n- Google Gemini: `GET \u002Fv1beta\u002Fmodels`\n\nFetched models appear in the model selector. Margin keeps the currently configured model as an option when a provider default or previously saved model is not returned by the provider list.\n\n## Privacy\n\nMargin sends only selected text segments to the configured provider. It does not send full page HTML by default, does not require login, does not use cloud sync, and does not include telemetry by default.\n\nProvider requests are made by the extension service worker using the endpoint and API key configured by the user. Provider privacy depends on the endpoint and model provider you choose.\n\nAPI keys are stored in browser extension storage. Treat the browser profile as part of your trusted environment.\n\n## X Optimization\n\nMargin includes an optional X-specific detector for timeline cards and longform article pages. When enabled, it targets `tweetText` content inside tweet articles and readable blocks inside X article views instead of scanning every visible text node.\n\nQuoted posts are disabled by default and can be enabled from options. Posts that X already marks as translated are skipped by default to avoid duplicate translation.\n\n## Local LLMs\n\nMargin supports local LLM runtimes through the OpenAI Compatible provider. This provider uses the OpenAI-style `\u002Fv1\u002Fchat\u002Fcompletions` API, allows an empty API key, and uses a lower default translation concurrency for local inference.\n\nCommon endpoint presets:\n\n```text\nLM Studio: http:\u002F\u002Flocalhost:1234\u002Fv1\u002Fchat\u002Fcompletions\nOllama: http:\u002F\u002Flocalhost:11434\u002Fv1\u002Fchat\u002Fcompletions\nllama.cpp server: http:\u002F\u002Flocalhost:8080\u002Fv1\u002Fchat\u002Fcompletions\n```\n\nTo use a local runtime:\n\n1. Start the local model server.\n2. Open Margin options.\n3. Select OpenAI Compatible as the provider.\n4. Select an endpoint preset, or enter the endpoint URL shown by your runtime.\n5. Leave API key empty unless your local gateway requires one.\n6. Click Fetch models and choose a served model from the model selector.\n7. Keep Request JSON mode enabled when supported. Disable it if the local runtime rejects the `response_format` request field.\n\nRuntime notes:\n\n- LM Studio commonly serves OpenAI-compatible requests at `http:\u002F\u002Flocalhost:1234\u002Fv1\u002Fchat\u002Fcompletions`.\n- Ollama requires its OpenAI-compatible API to be available at `http:\u002F\u002Flocalhost:11434\u002Fv1\u002Fchat\u002Fcompletions`.\n- llama.cpp server must be started with an OpenAI-compatible HTTP server enabled, commonly at `http:\u002F\u002Flocalhost:8080\u002Fv1\u002Fchat\u002Fcompletions`.\n- If Fetch models fails, confirm the local server is running, the endpoint URL ends with `\u002Fv1\u002Fchat\u002Fcompletions`, and the runtime exposes a compatible `\u002Fv1\u002Fmodels` endpoint.\n\nLocal model quality, speed, context length, and JSON reliability depend on the model and runtime. Instruct models with strong multilingual ability are recommended for translation.\n\n## Local Development\n\nInstall dependencies:\n\n```sh\ncorepack enable\npnpm install\n```\n\nRun type checks:\n\n```sh\npnpm check\n```\n\nRun lint:\n\n```sh\npnpm lint\n```\n\nRun extension manifest and security checks:\n\n```sh\npnpm check:extension\n```\n\nRun tests with coverage:\n\n```sh\npnpm test\n```\n\nBuild the extension:\n\n```sh\npnpm build\n```\n\nThe build uses Rolldown and writes the unpacked extension to `apps\u002Fextension\u002Fdist\u002F`.\n\n## Project Structure\n\n```text\napps\u002Fextension\u002Fsrc\u002Fbackground\u002F     Service worker, provider requests, settings, and cache flow\napps\u002Fextension\u002Fsrc\u002Fcontent\u002F        Page text detection, queueing, and translation insertion\napps\u002Fextension\u002Fsrc\u002Foptions\u002F        Extension options page\napps\u002Fextension\u002Fsrc\u002Fpopup\u002F          Popup UI and diagnostics\napps\u002Fextension\u002Fsrc\u002Fbackground\u002Fproviders\u002F      Provider adapters\napps\u002Fextension\u002Fsrc\u002Fshared\u002F         Shared types, defaults, storage, and messages\napps\u002Fextension\u002Fpublic\u002F             Static extension UI and content CSS\napps\u002Fextension\u002Fscripts\u002F            Build and extension validation scripts\ndocs\u002F                              Product, roadmap, principles, and threat model\n```\n\n## Troubleshooting\n\nEnable Debug mode in Margin options when a page appears enabled but no translations are inserted. The popup will show the current page detection count, queued blocks, running requests, pending translations, completed translations, error count, the latest error, and a sample detected text block.\n\nUse those values to separate the main failure modes:\n\n- `Detected blocks: 0` means the content script did not find readable text on the page.\n- A positive detected count with no running requests usually means the translation queue needs attention.\n- Error blocks or a latest error usually point to provider configuration, authentication, model, endpoint, or response format problems.\n\n## Known Limitations\n\n- Firefox is not the primary target yet.\n- Site-specific DOM handling is limited to a few high-value cases.\n- Highly dynamic web apps may move or remove translation blocks.\n- Large pages are translated in batches, so translations may appear progressively.\n- Provider rate limits, model availability, and output quality depend on the configured provider.\n\n## Documentation\n\n- [Product Requirements](docs\u002FPRD.md)\n- [Project Principles](docs\u002FPRINCIPLES.md)\n- [Threat Model](docs\u002FTHREAT_MODEL.md)\n- [Roadmap](docs\u002FROADMAP.md)\n- [Beta Testing Guide](docs\u002FBETA_TESTING.md)\n- [Release Checklist](docs\u002FRELEASE_CHECKLIST.md)\n\n## License\n\nMIT\n","Margin Read 是一个注重隐私的双语网页翻译浏览器扩展。它能够保留原始网页文本，并在相应的源文本块下方插入翻译内容，使读者能够在不丢失页面上下文的情况下比较两种语言版本。该扩展使用TypeScript编写，支持Manifest V3标准，适用于Chrome和Chromium浏览器。其核心功能包括通过弹出窗口进行即时翻译、智能检测可读文本块（如段落、标题等）、避免非阅读区域（如导航栏、表单等）干扰以及支持多种翻译服务提供商（如OpenAI、Anthropic Claude等）。此外，用户还可以自定义翻译显示样式，并选择是否显示浮动翻译按钮以手动触发翻译。此工具非常适合需要在浏览网页时进行双语文本对照阅读的学习者或研究人员使用。","2026-06-11 04:07:46","CREATED_QUERY"]