browser_launch
Launch a new browser session or attach to an existing Chrome debug port. Control the URL, viewport, device mode, and isolation for automated web interaction.
Instructions
Open a browser session. Choose the mode by what the task needs:
• mode:"fresh" (default choice) — launch our own throwaway Chrome; add incognito:true for a clean slate. Best for reverse-engineering a public flow or any site that does NOT need your existing login. No setup.
• mode:"attach" — connect to a Chrome the user already started with a debug port (default 9222). Use when you need REAL logins/cookies, or a human-looking browser (navigator.webdriver=false, real profile & fingerprint, passes basic bot checks). Requires starting Chrome first: ./bfa-chrome 9222 (Chrome 136+ needs a non-default profile — bfa-chrome handles that). You canNOT attach to an already-open normal Chrome; it has no debug port.
Multiple concurrent sessions are supported. In attach mode only port is used — profile, headless, incognito applies to fresh mode only. The session you launch becomes the ACTIVE one (tools without sessionId target it). In fresh mode bfa auto-follows a tab the page opens (so a game that launches in a new window keeps being driven); use browser_use_tab to switch manually. For phone/PG games pass device:"mobile" for a stable viewport.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | optional URL to open immediately | |
| mode | Yes | fresh = launch our own; attach = connect to a debug-port Chrome | |
| port | No | attach: Chrome remote-debugging port (default 9222) | |
| device | No | device preset. "mobile" = a STABLE 390x844 phone viewport (dpr 3, mobile layout + iPhone UA) that does not track the OS window, so it never self-shrinks and your click coordinates stay put — use this for phone/PG-style games. "desktop" = 1280x800. Overridden by an explicit `viewport`. | |
| profile | No | fresh: profile name under ~/.bfa/profiles | |
| headless | No | fresh: run headless (default false) | |
| viewport | No | page viewport. Default is 800x600 landscape, which letterboxes PORTRAIT canvas/WebGL games (Cocos) and lets their full-screen overlay swallow coordinate clicks. Set e.g. {width:390,height:844} so the canvas fills the viewport and page_click_at lands on the game. Keep hasTouch:false (default) so mouse clicks drive games that listen for mouse input. | |
| incognito | No | fresh: isolated context with no prior state |