Skip to content

About

一款高度自定义的浏览器插件,随时随地获得AI的帮助

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

AIction Browser

Select text → Trigger AI → Continue in chat

A lightweight Chrome extension for getting AI help on selected web content: select text, pick an action from the toolbar, read the streamed answer, then keep asking in a floating panel. Two engines to choose from: the optional official service (zero setup, no account needed) or any endpoint that follows the OpenAI chat completions format — your key, your model, your bill.

🛒 Available on the Chrome Web Store: Install AIction from Chrome Web Store

⚠️ Note: This is the browser extension component. For the desktop app, see AIction Desktop.

License: GPL v3 Chrome Web Store Version Languages

中文

Screenshots

Inline toolbar after selecting text Streamed answer in the floating card
Follow-up chat in dark theme Custom actions in the settings page

Features

Inline action toolbar

Select text on any page and a small toolbar appears next to it, with your actions plus one-click copy and read aloud.

Floating chat panels

The answer streams into a compact card; switch it to chat mode when you want to keep asking. Panels are draggable, pinnable, and several can stay open on the same page — sessions are per-page and in memory, gone when you close or reload the tab.

Actions you define

Every toolbar button is a prompt template. Write {selection} wherever the selected text should appear, then change the name, icon, template, order or visibility. Two actions are built in:

Action What it does
Explain Explains the selection: conclusion first, no restating the text, length matched to the complexity of the content
Translate Auto-directional Chinese ↔ English: mainly-English → Simplified Chinese, mainly-Chinese → English; translation only, original formatting kept

Official service (optional)

Works the moment you install it — no account, no key, no provider to configure. Anonymous use gets its own allowance, counted on the server; signing in raises it and keeps the same account across devices. Quota is shown as a percentage with a reset date, always as delivered by the server (the UI never invents numbers), and you can switch engines at any time in Options → Account or in the toolbar popup.

Using it means your selected text goes to our gateway and is forwarded to the model provider answering it — see Privacy below. If you'd rather keep your content away from our servers, use your own model instead.

Bring your own model

Add as many providers as you like — OpenAI, Anthropic, Google, DeepSeek, OpenRouter, or a custom gateway — then switch between them from the toolbar popup without leaving the page. Provider presets come from models.dev: leave the endpoint empty and the provider's default is used, fetch the model list with one click, and fill reasoning mode / effort with Smart Fill Params.

Model parameters

Nothing is sent unless you fill it in — an empty field means "endpoint / model default", never a value we invented.

Parameter Sent as Empty means
Max output tokens max_tokens Use the endpoint default
Context truncation threshold Applied locally (characters) No truncation
Reasoning mode On / off, mapped per provider Follow the model default
Reasoning effort low / medium / high Not sent

Output and context limits differ per provider copy of the same model, so the numbers from the data source are shown as hints only — the endpoint's own limit wins.

These fields apply to your own providers. The official service deliberately takes no model parameters from the client — its limits are clamped server-side per plan, so a mis-set field can never turn into a 400.

Read the selection aloud

Text-to-speech with Edge online voices or the system voice, adjustable speed, and automatic voice matching based on the detected language of the text.

Also included

  • Visible reasoning output — the thinking process is shown whenever the endpoint streams it
  • Dark / light / auto theme, 7 interface languages: English, 日本語, 한국어, Русский, Tiếng Việt, 简体中文, 繁體中文 (follows the browser by default)
  • Built-in PDF viewer — selection, actions and chat work inside PDFs
  • Editable system prompt with {selection}, {pageTitle}, {pageUrl}, {metaDescription}, {surround} and {uiLanguage} placeholders
  • Export / import the whole configuration as JSON, custom icons included

Install

Chrome Web Store (recommended)

Install from Chrome Web Store

Developer Mode

git clone https://github.com/lerixhe/aiction-browser.git
cd aiction-browser
npm install
npm run dev

Then:

  1. Open chrome://extensions
  2. Enable "Developer mode"
  3. Click "Load unpacked"
  4. Select the .output/chrome-mv3 directory

Quick Start

Select text on any page → pick an action on the toolbar → keep asking in the panel. The official service is already active, so there is nothing to configure.

Want to use your own model instead?

  1. Right-click the extension icon → Options → API Providers
  2. Add a provider (endpoint + key + model — or pick a preset, leave the endpoint empty and let models.dev supply the provider default)
  3. Click "Test Connection"
  4. Switch the engine in Account → AI engine (or in the toolbar popup's engine menu)

Configuration

Provider

Field Description Example
Endpoint URL OpenAI-compatible base URL, /v1 included https://api.openai.com/v1
API Key Kept in this browser's synced storage only sk-...
Model Model ID actually sent to the endpoint gpt-4o-mini

Account

Row What it shows
Sign-in state Sign in / sign out. Signing in is optional — it raises the allowance and keeps the same account across devices
Plan Current plan, subscription status, renewal date, link to the billing portal
Usage this period Used share of the allowance plus the reset date (also shown for anonymous use)
AI engine Official service ⇄ my own API key. This is the single switch that decides where requests go

Other settings

Section What it controls
Appearance Theme and interface language
API Providers Endpoints, keys, model and parameters
AI Actions Built-in and custom actions, toolbar quick actions, speech settings
System Prompt The instruction sent with every request; empty falls back to the built-in template
Backup & Migration JSON export / import
About Version, telemetry switch

Privacy

With your own API key: selected text, page content and AI replies go straight from your browser to the endpoint you configured — they never reach our servers, and we never see your key.

With the official service: the same content goes to our gateway (api.aiction.app) and is forwarded to the model provider that answers it. Requests are authenticated with a device token (anonymous) or an account token (signed in); both live only in the extension's background context — never in page scripts, never synced to your Google account, never sent to the analytics provider. Usage records keep the model id, token counts and status, not the content of your messages, and conversations stay in memory in the tab.

Signing in is optional either way, and anonymous usage statistics (feature counts, response latency) can be turned off in Settings → About. See docs/PRIVACY_POLICY.md.

Architecture

Three runtime contexts, talking only through messages — AI requests are made in the background only:

Content script  (selection detection, toolbar, chat panels)
    │  chrome.runtime.connect — AICTION_STREAM port (streamed events)
    ▼
Background      (the only place that calls AI endpoints; injects official credentials at runtime;
                 models.dev cache; PDF context menu)
    │  chrome.runtime.sendMessage (one-shot: connection test, model lists, current engine)
    ▼
Options / Popup / PDF viewer

Popup can also ask the content script to open a blank panel in the current tab (AICTION_OPEN_CHAT), so the question starts on the page rather than in the popup.

Which engine is in use — the official service or one of your own providers — is decided in exactly one place (resolveActiveProvider), so the popup, the settings page and the request path cannot disagree. Official credentials never leave the background: the UI only gets a read-only snapshot (sign-in state, plan, quota percentage) and asks the background which model is actually being used (AICTION_ENGINE_REQUEST).

Architecture & dev guide: AGENTS.md · Docs index: docs/README.md

Tech Stack

  • WXT — build framework
  • React 19 + TypeScript
  • Vercel AI SDK — streaming AI calls
  • Chrome Manifest V3

Development

Commands

Command Description
npm run dev Dev build with file watching
npm run dev:firefox Dev build for Firefox
npm run build Production build
npm run typecheck TypeScript type checking
npm test Unit tests (vitest, chrome.* stubbed)
npm run check:i18n Verify every locale dictionary matches the en key set
npm run check:auth-boundary Verify no credential module is reachable from content scripts
npm run mock:api Local mock of the official API (accounts, quota, streaming chat); --selftest runs its assertions
npm run zip Package the extension bundle
npm run screenshots / screenshots:frame Re-shoot / re-frame the store screenshots
npm run icons Regenerate extension icons from logo_raw.jpg

Path Aliases

~/* and @/* both map to src/*:

import { useUiTheme } from "@/shared/ui/theme"

i18n

src/shared/i18n/registry.ts is the single source of truth: the Locale type, validation, the language dropdown and prompt display names are all derived from it. Dictionaries in src/shared/i18n/locales/ are type-checked against the en key set, so a missing, extra or misspelled key is a compile error. Adding a language takes three files (a dictionary, public/_locales/<id>/messages.json, one row in the registry) — see AGENTS.md.

After Making Changes

  1. Run npm run typecheck, npm test and npm run build (add npm run check:i18n if you touched translations)
  2. Go to chrome://extensions
  3. Click the reload button on your extension
  4. Reload the target web page — stale content scripts from the old build otherwise linger

Contributing

  1. Fork the repository
  2. Create a branch: git checkout -b feature/xxx
  3. Make your changes
  4. Run npm run typecheck and npm run build
  5. Test in Chrome
  6. Submit a pull request

License

GPL-3.0

About

一款高度自定义的浏览器插件,随时随地获得AI的帮助

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages