| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
AI as a browser capability. A working sketch of what user-controlled AI on the open web could look like.
Note: Harbor + Web Agents is an invitation to explore what user-controlled AI on the web could look like. This is meant to start a conversation — not announce a product. Nothing here is a commitment that these ideas will appear in Firefox or any Mozilla product. But if we're going to shape how AI works on the web, it helps to have something concrete to talk about.
This repository contains two browser extensions plus a small native bridge that, together, implement the Web Agent API specification:
| Browser | Status | Notes |
|---|---|---|
| Firefox | ✅ Primary | Best supported, recommended for development |
| Chrome | ✅ Supported | Also works with Edge, Brave, Arc, Vivaldi |
| Safari | ⚠️ Experimental | macOS only, code in repo but not fully supported |
The problem (May 2026 edition): AI is everywhere in the browser, and somehow you have less choice than a year ago.
The vision: treat AI like fetch(). The browser holds your model connections, your credentials, and your tools. Websites declare what they need through standard APIs (window.ai, window.agent, navigator.modelContext). Permissions are per-origin and revocable. The agent doesn't free-roam the DOM — websites delegate via a scoped API, which keeps the prompt-injection surface manageable.
// Any website can use AI — no API keys, no backend, no vendor lock-in
const session = await window.ai.createTextSession();
const response = await session.prompt("Summarize this page");With the Web Agent API:
→ Read the full explainer · The 2026 landscape and where Harbor fits · Public site (whitepaper/)
Get Harbor running in 10 minutes.
| Tool | Install |
|---|---|
| Node.js 18+ | nodejs.org |
| Rust | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh |
| Ollama | ollama.com or brew install ollama |
| Firefox 109+ or Chrome 120+ | Firefox recommended |
git clone --recurse-submodules https://github.com/r/harbor.git
cd harbor
# If you already cloned without --recurse-submodules:
git submodule update --init --recursive# Build the Harbor extension
cd extension && npm install && npm run build && cd ..
# Build the Web Agents API extension
cd web-agents-api && npm install && npm run build && cd ..
# Build and install the native bridge
cd bridge-rs && cargo build --release && ./install.sh && cd ..ollama serve &
ollama pull llama3.2The system requires two extensions working together:
Firefox:
Chrome:
cd demo && npm install && npm startOpen http://localhost:8000 and try the interactive demos.
→ Detailed Firefox Setup | Detailed Chrome Setup
Safari (Experimental): Safari support is checked into the repo under installer/safari/Harbor/ but is not fully supported. See Safari Setup if you want to experiment.
Building a hackathon project or integrating AI into your web app?
The Web Agent API gives your web pages access to:
| API | What It Does |
|---|---|
| window.ai.createTextSession() | Chat with AI models |
| window.agent.tools.list() | List available MCP tools |
| window.agent.tools.call() | Execute tools (search, files, databases) |
| window.agent.run() | Run autonomous agent tasks |
| window.agent.browser.activeTab.readability() | Read page content |
<!DOCTYPE html>
<html>
<body>
<button id="ask">Ask AI</button>
<div id="output"></div>
<script>
document.getElementById('ask').onclick = async () => {
// 1. Request permission
await window.agent.requestPermissions({
scopes: ['model:prompt'],
reason: 'To answer your question'
});
// 2. Create session and prompt
const session = await window.ai.createTextSession();
const response = await session.prompt('What is 2+2?');
document.getElementById('output').textContent = response;
};
</script>
</body>
</html>| Document | Description |
|---|---|
| API Quickstart | Get from zero to working code in 15 minutes |
| Web Agents API Reference | Complete API docs with examples |
| Building on the Web Agents API | Portable guide for other projects — copy into your repo for examples, API, capabilities |
| Testing your app | Unit tests (mock) and E2E (Playwright + Harbor) — generate harness from scripts/generate-test-harness.mjs |
| JS API Reference | Detailed window.ai and window.agent reference |
| LLMS.txt | AI-optimized reference for Claude, Cursor, Copilot |
| Working Examples | Copy-paste ready code |
| Demo Source Code | Full demo implementations |
Using an AI coding assistant? Point it to docs/LLMS.txt — it's designed for AI tools to quickly understand and build with the Web Agents API. Building from another project? Copy docs/BUILDING_ON_WEB_AGENTS_API.md into your repo (e.g. docs/ or .cursor/) so the API, examples, and capabilities are in context.
Want your AI to do more? Create MCP servers that give it new capabilities:
# Copy the template and start building
cp -r mcp-servers/templates/javascript my-tool
cd my-tool && edit server.js| Document | Description |
|---|---|
| Tool Creation Quickstart | Build your first tool in 15 minutes |
| MCP Authoring Guide | Complete guide (JS and WASM) |
| Example: Gmail Integration | Real-world OAuth example |
Permissions: All capabilities require user consent. Request what you need:
await window.agent.requestPermissions({
scopes: ['model:prompt', 'mcp:tools.list', 'mcp:tools.call'],
reason: 'Enable AI features'
});Feature Flags: Some APIs are gated. Users enable them in the sidebar:
Want to contribute to Harbor or build your own Web Agent API implementation?
┌─────────────────────────────────────────────────────────────────┐
│ WEB PAGE │
│ window.ai / window.agent (injected APIs) │
└───────────────────────────────┬─────────────────────────────────┘
│ postMessage
▼
┌─────────────────────────────────────────────────────────────────┐
│ WEB AGENTS API EXTENSION │
│ • Implements Web Agent API spec • Permission prompts │
│ • Injects window.ai/agent • Delegates to Harbor │
└───────────────────────────────┬─────────────────────────────────┘
│ Cross-extension messaging
▼
┌─────────────────────────────────────────────────────────────────┐
│ HARBOR EXTENSION │
│ • LLM provider selection • In-browser WASM/JS MCP │
│ • MCP server management • Chat sidebar UI │
└───────────────────────────────┬─────────────────────────────────┘
│ Native Messaging
▼
┌─────────────────────────────────────────────────────────────────┐
│ RUST BRIDGE │
│ • LLM provider connections • Native MCP servers │
│ • Ollama/OpenAI/Anthropic • OAuth flows │
└─────────────────────────────────────────────────────────────────┘
| Document | Description |
|---|---|
| Architecture | System design and component details |
| Contributing Guide | Build, test, and submit changes |
| MCP Host | MCP execution environment internals |
| Test Suite | Run and write Harbor's unit and E2E tests |
# Watch mode
cd extension && npm run dev # Auto-rebuild on changes
cd bridge-rs && cargo build # Rebuild after Rust changes
# Test
cd bridge-rs && cargo test
cd extension && npm testThe Web Agents API extension implements the Web Agent API specification. The specification itself is browser-agnostic and could be implemented by browsers natively or by other extensions.
| Document | Description |
|---|---|
| Whitepaper | The vision: user-controlled AI on the web |
| Specification Overview | What the Web Agent API is and why it matters |
| Full Explainer | Complete spec with Web IDL and security model |
| Security & Privacy | Threat model and mitigations |
harbor/ ├── whitepaper/ # Public whitepaper (GitHub Pages) ├── spec/ # Web Agent API specification (browser-agnostic) ├── extension/ # Harbor extension (LLM connections, MCP hosting, sidebar) ├── web-agents-api/ # Web Agents API extension (implements window.ai/window.agent) ├── bridge-rs/ # Rust native messaging bridge ├── demo/ # Working examples ├── docs/ # Implementation documentation ├── mcp-servers/ # Built-in MCP servers (WASM, JS) └── installer/ # Safari Xcode project (experimental)
This is version 0.1.0, released as a conversation starter. Some features are still in development:
See individual TODO comments in the source for specific implementation notes.
MIT — See LICENSE for details.
| Back | FazBrowse Home | New Git URL |