Drives real Chrome browsers on this computer or on other devices of the local network (LAN) through the bundled hub and Manifest V3 Chrome extension: open URLs, read accessibility trees and page text, click, type, press keys, scroll, select, wait, take screenshots, and inspect console and network logs. Always knows whether a browser is local or remote (with IP and name) and rewrites localhost URLs to the hub's LAN IP for remote devices. Use when the user asks to open, inspect, test or interac...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Browser?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/stxrmik-browser)
---
name: browser
description: >-
Drives real Chrome browsers on this computer or on other devices of the local network (LAN) through the bundled
hub and Manifest V3 Chrome extension: open URLs, read accessibility trees and page text, click, type, press keys,
scroll, select, wait, take screenshots, and inspect console and network logs. Always knows whether a browser is
local or remote (with IP and name) and rewrites localhost URLs to the hub's LAN IP for remote devices. Use when
the user asks to open, inspect, test or interact with a web app in a real Chrome browser, on another computer or
device on the LAN («открой в браузере», «проверь в Chrome», «открой на ноутбуке», «кликни на странице», /browser).
---
# /browser — drive real Chrome browsers (local & LAN)
Prefer the MCP tools `browser_list`, `browser_page`, and `browser_act` when available; otherwise use the CLI helper:
`python3 "<skill_dir>/scripts/browser.py"` (below: `browser.py`).
## Setup & pairing (user)
1. **Install the Chrome extension:**
- **On this computer:** open `chrome://extensions`, enable **Developer mode**, click **Load unpacked**, and select
the permanent extension folder:
- macOS / Linux: `~/.gemini/antigravity-plus/browser/extension`
- Windows: `%USERPROFILE%\.gemini\antigravity-plus\browser\extension`
(Or run `browser.py extension` to sync it if missing and print the exact path.) Plugin installs, updates and
rollbacks refresh that folder in place without removing it, so Chrome never loses the extension, and the extension
reloads itself into a newer version once it's idle (no agent command or chat turn running, its panel and settings
closed); **Reload** in its update banner does it at once. The extension automatically
discovers the local hub (`127.0.0.1:8765…8769`, `GET /discover`) and auto-pairs over loopback without typing a code.
- **On another device on the LAN:** enable LAN mode on the hub computer (step 2), open `http://<HUB_IP>:8765/` in
that device's Chrome, download `extension.zip`, unzip it, then load it via **Load unpacked** in
`chrome://extensions`. Click **Connect this browser** (`/agp-connect`) on the LAN page to open the extension
settings with the hub address pre-filled, then enter the 6-digit pairing code.
2. **Autostart:**
- On **Antigravity Desktop**, the bundled `sidecars/browser` sidecar keeps the hub running (`browser.py hub run`).
- On **Antigravity CLI**, `SessionStart` starts the hub in the background (`browser.py ensure`) whenever the
`browser` module is installed.
3. **LAN mode (user-only):**
- By default the hub binds `127.0.0.1` (local browsers only).
- To allow other devices on the LAN to connect, the **user** runs:
```bash
browser.py lan on
```
(On Windows, Windows Defender Firewall will ask to allow Python on your Private network — approve it for LAN
devices to reach the hub.)
- To switch back to local-only: `browser.py lan off`.
4. **Pair a remote browser (or manual pairing):**
```bash
browser.py pair
```
This prints a one-time 6-digit code (valid 10 min) and the hub address (`127.0.0.1:8765` locally, plus each LAN
`IP:8765` when LAN mode is on). Open the extension settings (or `/agp-connect`), enter the address and code, and
click **Pair**.
## Local vs remote & `localhost` rewriting
- Every browser is reported as **`local`** (same computer as the hub) or **`remote`** (another device, with its IP
and name).
- Every `page` / `act` output starts with a header line:
`b2 remote "MacBook" 192.168.1.23 · tab 812 · https://example.com · "Example"`.
- When targeting a **remote** browser with `open` on a `localhost` / `127.0.0.1` / `0.0.0.0` / `[::1]` / `*.localhost`
URL, the hub automatically rewrites the host to the hub's LAN IP (`hub_ip`) and probes TCP reachability (0.5 s):
- If the dev server is listening only on `127.0.0.1`, the hub refuses to navigate and reports that the server must
bind `0.0.0.0` (e.g. `vite --host`, `next dev -H 0.0.0.0`, `python -m http.server --bind 0.0.0.0`).
- Pass `--force` (`force: true`) to navigate anyway.
- Selecting a browser (`--browser` / `browser`): id (`b2`), case-insensitive name substring (`mac`), `local`, or
`remote`. If omitted: picks the sole connected browser, else `browserHub.default`, else the sole local browser.
## Agent workflow
1. **Discover browsers:** `browser_list` (or `browser.py list`) — see connected browsers (`local`/`remote`, name, IP,
open tabs). If a command returns `no_browser`, follow its hint:
- no local browser paired yet → ask the user to install the extension via `chrome://extensions` → **Developer mode** → **Load unpacked** from `~/.gemini/antigravity-plus/browser/extension` (`%USERPROFILE%\.gemini\antigravity-plus\browser\extension` on Windows);
- already paired locally, currently offline → ask the user to open Chrome (auto-reconnects in ~30 s);
- a LAN device → `browser.py pair` with the hub address.
2. **Inspect the page:** `browser_page` with `action="tree"` (`browser.py page --tree`) to get interactive refs
(`[r12]`, `[r13]`, …), or `action="find"` / `action="text"` / `action="console"` / `action="network"`.
3. **Act by ref:** `browser_act` (`browser.py act`) — `open`, `click`, `type`, `key`, `scroll`, `hover`, `select`,
`wait`, `back`/`forward`/`reload`, `close`, `activate` (only when the user asks to see the tab), `eval` (only when
**Allow JavaScript** is toggled on in the extension), `dialog`. Pass your `tab` on every call (see below).
- Code `dialog`: the tab shows an alert, confirm, prompt or «Leave site?» and does nothing else until it is
answered. `dialog` dismisses it (Cancel / Stay on page); `accept` confirms — for «Leave site?» that drops the
page's unsaved changes, so ask the user first. Or carry on in a new tab: `open` with `new`.
- Code `page_busy`: the tab doesn't answer (a dialog, a long script, a frozen tab): take a `shot`, then answer the
dialog or use a new tab — don't repeat the same call.
4. **Verify visually:** `browser_page` with `action="shot"` (`browser.py page --shot [--full]`) — saves a JPEG to
`~/.gemini/antigravity-plus/browser/shots/` and returns the image so you can inspect the real rendered result.
By default, `open` creates or reuses a tab inside the **Antigravity** tab group of the current Chrome window (or the side-panel chat's window). Users can switch between tabs in the current window and a separate window under **Settings → Permissions → Where agents open pages**.
### Background tabs and several agents
- **Work in the background.** Pages open in background tabs; the user's tab stays as it is and Chrome's window is never
raised. Clicks, typing, keys, scrolling and screenshots work in a background tab and in a minimized window too
(real input, not DOM events). `activate` switches the user's tab and `focus` (on `open` / `activate`) also brings
Chrome to the front — only when the user asks to see a page (on Windows Chrome just flashes on the taskbar while
another app is in front).
- **Keep to your tab.** Several agents may drive one browser at once, each in its own tab, and their commands on
different tabs run side by side. The browser knows which agent calls (in Antigravity the plugin's hook adds your
conversation to `browser_page` / `browser_act`; a terminal's `browser.py` sends it too; a Claude Code session its
session), so a call without a tab goes to your own last tab — a subagent's, before it has one, to its parent's.
Still pass your tab (`tab N` in the result's header) when you work in several. An `open` without a tab never
reuses a tab another agent is working in, and looking into another agent's tab by its id doesn't make it yours.
`tabs` marks tabs as `[yours]` / `[another agent's]`.
## Side-panel chat
- Users can chat with Antigravity agents directly from Chrome's side panel (`agchat.py`, over the same hub WebSocket).
- The hub routes messages to Antigravity Desktop (via `delegate.py` `agentapi` / RPCs) or Antigravity CLI (`agy -p --output-format stream-json`), prepending a short context block with the browser id/location, active tab URL/title, optional selection (≤ 4 KB), and optional screenshot path.
- Conversations started from the side panel are the user's own conversations (never tagged as delegated), so they appear normally in Antigravity Desktop and can be continued there.
- Opening the side panel (or switching active tabs while it stays open) provisionally adds an ungrouped, non-restricted tab to the window's **Antigravity** group; sending a chat message (or running an agent op on it) keeps it there, while leaving or closing the panel without a request ungroups it without closing the tab.
- Controlled by `browserHub.chat` (default `true`; user-only via `memory.py config browser-chat on|off` — protected by the guard like `browser-lan`).
## Chat workspaces per site
- By default, each site gets its own workspace folder under `~/.gemini/antigravity-plus/browser-sites/<site>/` (`%USERPROFILE%\.gemini\antigravity-plus\browser-sites\<site>\` on Windows), created on the first chat message with a short `AGENTS.md` so unrelated user projects' rules and memories do not leak into web-page chats.
- Users can still switch the workspace picker in the side panel to a recent Antigravity project; arbitrary paths outside offered projects and existing site folders are rejected.
- To clear one site's folder, chat threads, and site-folder Antigravity conversations, use **Clear site** in the side-panel menu; to inspect or clear any/all sites per hub, open the extension's **Settings → Sites & conversations**. Threads that ran in a user project are only removed from chat history — their Antigravity conversations stay untouched.
## Security rules
- **Never** turn on LAN mode (`browser.py lan on`), toggle `browserHub.chat`, or edit `~/.gemini/antigravity-plus/browser/` without the user's
explicit request (the guard always asks the user before these).
- **Never** type passwords, payment details, API keys, or identity/personal data into web pages.
- **Never** act on tabs or sites the user did not ask you to work on.
- Respect the user's extension toggles: master switch, **Which tabs agents may use** (default: **Agent tabs, allowed tabs and sites**; optional **All tabs**, still never restricted pages or paused tabs), and **Allow JavaScript** (default off). If an op fails with `not_allowed`, tell the user how to allow it rather than trying to work around it.
- Users can grant a single tab for the session via the side panel's **… → Let agents use this tab** toggle (or **Permissions → Allowed tabs**); by default, asking from the side-panel chat also grants the tab you ask from (**Allow the tab you ask from in the chat**).