Portable Context — carry your AI conversations anywhere
Save, summarize, and inject chat context across ChatGPT, Claude, and Gemini.
Go + WebAssembly core. Chrome MV3 extension. Zero backend. Your data never leaves your browser.
Portex is a Chrome extension that lets you save a conversation from one AI provider, summarize it, and inject that context into a different provider — in one click. No more copy-pasting walls of text between tabs.
Core loop: Save Chat → Summarize → Inject into another provider
- Save — capture full conversations from ChatGPT, Claude, or Gemini with one click
- Summarize — local 3-tier compression (no API key needed) or AI-powered via your own OpenAI/Anthropic key
- Inject — paste formatted context into any provider's chat input automatically
- Search — find sessions by keyword across titles, tags, and message content
- Export — download sessions as JSON
- Private — all data lives in
chrome.storage.local, no backend, no analytics
portex/
extension/ JS — Chrome MV3 thin glue layer
manifest.json Extension manifest (MV3, wasm-unsafe-eval CSP)
popup.html Popup UI
popup.js Controller (storage, actions, rendering)
scraper.js Content script — scrapes DOM messages per provider
injector.js Content script — pastes context into chat input
wasm_bridge.js Loads Go WASM, exposes async API
wasm_exec.js Go runtime helper (auto-generated)
portex.wasm Compiled binary (auto-generated)
wasm/ Go — core logic compiled to WASM
main.go Registers exported functions, keeps runtime alive
parser.go Raw scraped messages → structured Session
summarizer.go Layered compression + OpenAI/Anthropic API calls
storage.go UUID gen, serialize/deserialize, keyword search
injector.go Formats provider-specific inject prompts
Makefile Build commands
landing/ Static site (Vercel / GitHub Pages)
index.html
privacy.html
- Go 1.22+
- Chrome or Chromium-based browser
cd wasm
make buildThis compiles Go → extension/portex.wasm and copies wasm_exec.js from your Go installation.
- Open
chrome://extensions - Enable Developer Mode
- Click Load unpacked → select the
extension/folder
brew install binaryen
cd wasm
make compressAll Go functions are registered on globalThis and wrapped by WasmBridge in JS.
| Function | Returns | Description |
|---|---|---|
parseSession(provider, rawJSON) |
{ok, data} |
Parse scraped messages into Session JSON |
summarizeSession(sessionJSON) |
{ok, data} |
Local 3-tier compression |
buildInjectPrompt(input, provider, maxChars?) |
{ok, data} |
Format provider-specific inject prompt |
serializeSession(sessionJSON) |
{ok, data} |
Validate + canonical JSON |
deserializeSession(sessionJSON) |
{ok, data} |
Parse + validate |
generateSessionID() |
{ok, data} |
UUID v4 |
searchSessions(sessionsJSON, keyword) |
{ok, data} |
Filter by keyword |
callAIAPI(apiKey, model, prompt) |
Promise<{ok, data}> |
Call OpenAI or Anthropic |
Session {
id string
provider "chatgpt" | "claude" | "gemini"
timestamp number (Unix ms)
tags string[]
messages Message[]
summary string
title string
}
Message {
role "user" | "assistant"
content string
timestamp number (Unix ms)
}
Stored in chrome.storage.local under keys portex_sessions and portex_settings.
- CSP —
script-src 'self' 'wasm-unsafe-eval'(required for WASM, no inline scripts) - API keys — stored in
chrome.storage.local(encrypted by Chrome), never in code or logs - Content scripts — communicate only via
chrome.runtime.onMessage, notwindow.postMessage - No dependencies — zero external CDNs, analytics, or tracking
- Input validation — all data validated in Go before processing, provider names allowlisted
Contributions are highly welcome! Whether you're fixing bugs, adding new AI providers (like Gemini), or improving the UI.
- Fork the repo
- Create a feature branch (
git checkout -b feat/my-feature) - Make your changes in
extension/(JS/HTML) orwasm/(Go) - Run
cd wasm && make buildto compile the Go code into WASM. - Load the extension in Chrome (
chrome://extensions-> Load unpacked) and test manually - Open a Pull Request!
To help you get started quickly:
- Adding a new AI Provider? Check
extension/scraper.jsto see how DOM messages are extracted, then look atwasm/parser.goif the data structure needs specific handling. - Modifying the UI? Update
extension/popup.htmlandextension/popup.js(No build required for JS changes, just hit the refresh icon on your extension). - WASM Bridge: If you create a new Go function, make sure to export it in
wasm/main.goand add a wrapper inextension/wasm_bridge.js.
- ChatGPT end-to-end (save, summarize, inject)
- Claude end-to-end
- Gemini scraper support
- Session tagging and filtering
- Import sessions from JSON
- TinyGo build for smaller WASM binary
MIT