Phravexa

CI

A Chrome extension (Manifest V3) that translates or rephrases selected text with your own OpenAI, Anthropic or DeepSeek API key and copies the result to your clipboard, formatting included.

Features

Installation

Install from the Chrome Web Store, or for development:

  1. Clone this repository
  2. Open Chrome and navigate to chrome://extensions/
  3. Enable “Developer mode” in the top right
  4. Click “Load unpacked” and select the extension/ directory
  5. The extension icon will appear in your toolbar

Setup

  1. Click the extension icon in the toolbar
  2. Click “Go to Settings” to configure:
    • AI Provider: Choose between OpenAI, Anthropic, or DeepSeek
    • API Key: Enter your API key for the selected provider
    • Model (optional): Leave empty for the built-in default, or enter another model name
    • Languages: Add languages you want to translate to (e.g., Spanish, French, German)
    • Tone: Set the default rephrasing tone (professional, casual, concise, etc.)

Getting API Keys

Usage

  1. Select any text on a webpage
  2. Right-click to open the context menu
  3. Choose a language from the menu:
    • English: Rephrase in English with your chosen tone
    • Other Languages: Translate to that language AND rephrase with your tone
  4. In a text box or editor the selection is replaced with the result; it is also copied to your clipboard
  5. Paste anywhere with Cmd+V (Mac) or Ctrl+V (Windows)

How It Works

Privacy & Security

Permissions

Development

Built with Chrome Extension Manifest V3. Pure logic (prompt building, provider requests, response parsing, error mapping) lives in extension/lib/core.js so it can be unit-tested in Node.

Tests

npm install                      # installs Playwright
npx playwright install chromium  # once
npm test                         # unit tests + end-to-end tests

CI runs both on every push (.github/workflows/ci.yml).

Building for Production

./extension/build.sh

Creates dist/phravexa-<version>.zip with only the extension’s runtime files and verifies the contents (file list, manifest, referenced files).

File Structure

extension/
├── manifest.json          # Extension configuration
├── background.js          # Service worker: menu, selection, API calls, clipboard
├── lib/core.js            # Pure logic shared by the worker and settings page
├── content.js             # Content script for page interaction
├── content.css            # Styles for content script
├── offscreen.js           # Offscreen document for clipboard access
├── offscreen.html         # Offscreen document HTML
├── options.html           # Settings page
├── options.js             # Settings page logic
├── popup.html             # Extension popup
├── popup.js               # Extension popup logic
├── build.sh               # Build script for packaging
└── icons/                 # Extension icons
    ├── icon16.png
    ├── icon48.png
    └── icon128.png

Technologies

License

MIT License - Feel free to use and modify as needed.

Contact

TR1.eu (Ari Chazan), Barcelona, Spain - support@itbcn.com