AI-driven browser agent Chrome extension that lets users issue natural-language instructions and have an AI agent observe, scrape, and take actions on the currently active tab.
miru/
├─ src/
│ ├─ background/
│ │ └─ serviceWorker.ts # Task orchestrator (no DOM access)
│ ├─ content/
│ │ └─ contentScript.ts # DOM reader & executor
│ ├─ ui/
│ │ ├─ popup.html
│ │ ├─ popup.ts
│ │ └─ popup.css
│ ├─ shared/
│ │ ├─ types.ts # Action schemas & message types
│ │ └─ constants.ts
│ └─ manifest.json
├─ public/
│ └─ icon.png
├─ package.json
├─ tsconfig.json
└─ README.md
Before building, you need to add an icon file:
- Create or download a PNG icon (16x16, 48x48, and 128x128 pixels)
- Save it as
public/icon.png
Quick placeholder option: You can use any PNG image as a temporary placeholder. The extension will load without a proper icon, but Chrome may show warnings.
npm installnpm run buildThis will:
- Compile TypeScript files to JavaScript
- Copy manifest.json and public assets to
dist/
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" (toggle in top right)
- Click "Load unpacked"
- Select the
dist/folder from this project - The Miru extension should now appear in your extensions list
- Navigate to any website (e.g.,
https://example.com) - Click the Miru extension icon in the Chrome toolbar
- Click "Get Page Summary" button
- You should see JSON output with:
- URL
- Page title
- Visible text length
- Link count
- Form count
npm run watchThis will automatically rebuild when you make changes to TypeScript files.
npm run clean
npm run buildsrc/background/serviceWorker.ts: Background service worker that orchestrates tasks and manages communication between popup and content scriptssrc/content/contentScript.ts: Content script injected into web pages to read DOM, extract page information, and execute actionssrc/ui/popup.ts: Popup UI controller that handles user interactions and displays resultssrc/shared/types.ts: Shared type definitions including action schemas and message typessrc/shared/constants.ts: Shared constants used across the extension
- User clicks popup button
- Popup sends message → service worker
- Service worker injects content script (if needed)
- Content script reads page metadata and returns structured response
- Service worker sends result back to popup
- Popup displays JSON output
The extension uses:
activeTab: Access to the active tab when user interactsscripting: Inject content scriptsstorage: Store extension data (for future use)tabs: Query tab information<all_urls>: Access to all websites
This is the foundation. Future enhancements will include:
- AI planner integration
- Action execution (CLICK, TYPE, EXTRACT, etc.)
- Natural language instruction processing
- Action history and inspection
MIT