Files
BrowserOS/apps/agent
Felarof 2b605bdaa3 feat: add inline chat experience to new tab page (#418)
* feat: add inline chat experience to new tab page

Bring the full sidepanel chat experience to the new tab page. When
users select an AI suggestion from the search bar, the page transitions
inline to a full chat view instead of opening the sidepanel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: remove unnecessary comments from NewTab.tsx

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: address PR review comments

- Move NEWTAB_CHAT_STARTED_EVENT tracking to startInlineChat where it
  actually fires (was dead code in NewTabChat handleSubmit)
- Add NEWTAB_CHAT_RESET_EVENT tracking to handleNewConversation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: gate newtab chat behind NEWTAB_CHAT_SUPPORT feature flag

When the flag is off (BrowserOS < 0.40.0), falls back to opening the
sidepanel via openSidePanelWithSearch (previous behavior). In dev mode
all features are enabled, so inline chat works during development.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat: add newtab origin context to chat system prompt

When chatting from the new tab page, the AI is instructed to open
content in new tabs rather than navigating the current tab, keeping
the user's new tab page accessible.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 12:02:39 -08:00
..
2026-01-19 11:17:21 -08:00
2026-01-30 23:33:57 +05:30
2026-03-04 19:12:47 +05:30
2026-02-27 00:22:59 +05:30
2026-01-19 11:17:21 -08:00
2026-03-02 13:37:01 +05:30
2026-02-27 00:22:59 +05:30
2026-01-30 23:33:57 +05:30
2026-02-23 07:28:45 -08:00

BrowserOS Agent Chrome Extension

The official Chrome extension for BrowserOS Agent, providing the UI layer for interacting with BrowserOS Core and Controllers. This extension enables intelligent browser automation, AI-powered search, and seamless integration with multiple LLM providers.

Features

  • AI-Powered New Tab: Custom new tab page with unified search across Google and AI assistants
  • Side Panel Chat: Full-featured chat interface for interacting with BrowserOS Core
  • Multi-Provider Support: Connect to various LLM providers (OpenAI, Anthropic, Azure, Bedrock, and more)
  • MCP Integration: Model Context Protocol support for extending AI capabilities
  • Visual Feedback: Animated glow effect on tabs during AI agent operations
  • Privacy-First: Local data handling with configurable provider settings

Project Structure

entrypoints/
├── background.ts          # Service worker for extension lifecycle
├── content.ts             # Content script (Google pages)
├── glow.content/          # Visual glow effect for active AI operations
├── newtab/                # Custom new tab page
├── sidepanel/             # AI chat side panel
├── onboarding/            # First-time user onboarding flow
└── options/               # Extension settings dashboard

components/
└── ui/                    # Shadcn UI components

lib/                       # Shared utilities and hooks

Entrypoints

Background (background.ts)

The service worker that manages:

  • Side panel toggling via browser action
  • BrowserOS Core health checks
  • MCP tools fetching
  • LLM provider configuration backup
  • Extension installation triggers (opens onboarding)

New Tab (newtab/)

Custom new tab replacement featuring:

  • Unified Search Bar: Search Google or ask AI directly
  • Tab Context: Attach open tabs to provide context for AI queries
  • Search Suggestions: Real-time suggestions from multiple providers (Google, Bing, DuckDuckGo, Yahoo, Yandex)
  • AI Suggestions: Context-aware BrowserOS action suggestions
  • Top Sites: Quick access to frequently visited sites
  • Theme Toggle: Light/dark mode support

Side Panel (sidepanel/)

The main chat interface for BrowserOS:

  • Chat Modes: Switch between chat and agent modes
  • Provider Selector: Choose from configured LLM providers
  • Tab Attachment: Include browser tab content as context
  • Tool Calls: Visual display of MCP tool invocations
  • Message Actions: Like/dislike feedback, copy responses
  • Conversation Management: Start new conversations, view history

Onboarding (onboarding/)

Multi-step onboarding flow for new users:

  • Welcome screen with product highlights
  • Feature showcase with animated cards
  • Step-by-step setup wizard
  • Provider configuration guidance

Options (options/)

Settings dashboard with multiple sections:

  • AI Settings: Configure LLM providers (API keys, models, base URLs)
  • LLM Hub: Manage chat-specific provider settings
  • MCP Settings: View and manage MCP server connections
  • Connect MCP: Add managed or custom MCP servers

Glow Content (glow.content/)

Content script that creates a visual indicator (pulsing orange glow) around the browser viewport when an AI agent is actively working on a tab.

How Tools Are Used

Bun

Bun is the exclusive runtime and package manager:

  • All scripts use bun run <script> instead of npm
  • Package installation via bun install
  • Environment files automatically loaded (no dotenv needed)
  • Enforced via engines field in package.json
bun install          # Install dependencies
bun run dev          # Development mode
bun run build        # Production build
bun run lint         # Run Biome linting

Biome

Unified linter and formatter configured in biome.json:

  • Formatting: 2-space indentation, single quotes, no semicolons
  • Linting: Recommended rules plus custom rules for unused imports/variables
  • CSS Support: Tailwind directives parsing enabled
  • Import Organization: Automatic import sorting via assist actions
bun run lint         # Check for issues
bun run lint:fix     # Auto-fix issues

Development

Prerequisites

  • Bun installed
  • Chrome or Chromium-based browser
  • BrowserOS Core running locally (for full functionality)

Setup

# Install dependencies
bun install

# Start development server
bun run dev

# Build for production
bun run build

# Create distributable zip
bun run zip

Loading the Extension

  1. Run bun run dev to start the development server
  2. Open Chrome and navigate to chrome://extensions
  3. Enable "Developer mode"
  4. Click "Load unpacked" and select the dist/ directory

Environment Variables

Create a .env.development file for local development:

SENTRY_ORG=your-org
SENTRY_PROJECT=your-project
SENTRY_AUTH_TOKEN=your-token

GraphQL Schema

Codegen requires a GraphQL schema. By default it uses the bundled schema/schema.graphql, so no extra setup is needed. If you have access to the original API source, you can set the following environment variable

GRAPHQL_SCHEMA_PATH=/path/to/api-repo/.../schema.graphql

Scripts

Script Description
bun run dev Start development mode with hot reload
bun run build Build production extension
bun run zip Create distributable zip file
bun run lint Run Biome linter
bun run lint:fix Auto-fix linting issues
bun run typecheck Run TypeScript type checking
bun run clean:cache Clear build caches