|
1 | 1 | --- |
2 | 2 | title: Remote Browser Connection |
3 | 3 | description: Connect to an existing Chrome browser for containerized development, custom profiles, and remote workflows |
4 | | -sidebar_position: 11 |
5 | 4 | --- |
6 | 5 |
|
7 | 6 | # Remote Browser Connection |
8 | 7 |
|
9 | | -## What Is Remote Browser Connection? |
| 8 | +Connect Roo to an existing Chrome browser instead of launching a new one. This feature bypasses Roo's default browser process creation, allowing Roo to work in containerized environments, with custom browser profiles, and across remote development workflows. |
10 | 9 |
|
11 | | -Connect Roo to an existing Chrome browser instead of launching a new one. This powerful feature bypasses Roo's default browser process creation, enabling you to use Roo in containerized environments, with custom browser profiles, and across remote development workflows. |
| 10 | +> **Key Benefit:** Separates the browser process from the VS Code environment, solving common challenges in containerized development and remote workflows. |
12 | 11 |
|
13 | | -> **Key Benefit:** Remote browser connection solves common challenges with containerized development and remote workflows by separating the browser process from the VS Code environment. |
| 12 | +## Use Cases |
14 | 13 |
|
15 | | -### When To Use Remote Browser Connection |
| 14 | +- **DevContainers:** Connect from containerized VS Code to host Chrome browser |
| 15 | +- **Remote Development:** Use local Chrome with remote VS Code server |
| 16 | +- **Custom Chrome Profiles:** Use profiles with specific extensions and settings |
| 17 | +- **Shared Sessions:** Connect multiple Roo instances to one browser |
16 | 18 |
|
17 | | -- **DevContainers:** Connect from containerized VS Code to a Chrome browser running on your host system |
18 | | -- **Remote Development:** Use Chrome on a local development machine while working on a remote server |
19 | | -- **Custom Chrome Profiles:** Leverage specific profiles with your preferred extensions and settings |
20 | | -- **Shared Browser Sessions:** Allow multiple Roo instances to connect to the same browser session |
| 19 | +## Setup |
21 | 20 |
|
22 | | -## Setting Up Remote Browser Connection |
23 | | - |
24 | | -To use the remote browser connection feature, you'll need to complete three simple steps: launch Chrome with remote debugging enabled, configure Roo settings, and (if using containers) set up network access. |
| 21 | +Connect to a remote browser in three steps: |
25 | 22 |
|
26 | 23 | ### 1. Launch Chrome with Remote Debugging |
27 | 24 |
|
28 | | -Launch Chrome with the remote debugging port enabled: |
| 25 | +Start Chrome with debugging enabled: |
29 | 26 |
|
30 | | -**On macOS:** |
| 27 | +**macOS**: |
31 | 28 | ```bash |
32 | 29 | /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug |
33 | 30 | ``` |
34 | 31 |
|
35 | | -**On Windows:** |
| 32 | +**Windows**: |
36 | 33 | ```bash |
37 | 34 | "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir=C:\chrome-debug |
38 | 35 | ``` |
39 | 36 |
|
40 | | -**On Linux:** |
| 37 | +**Linux**: |
41 | 38 | ```bash |
42 | 39 | google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug |
43 | 40 | ``` |
44 | 41 |
|
45 | | -> **Note:** The `--user-data-dir` parameter creates a separate Chrome profile that won't interfere with your regular browsing. |
46 | | -
|
47 | | -### 2. Configuring Roo Settings |
| 42 | +> **Note:** The `--user-data-dir` parameter creates an isolated Chrome profile that doesn't affect your regular browsing. |
48 | 43 |
|
49 | | -Once Chrome is running with remote debugging, configure Roo: |
| 44 | +### 2. Configure Roo Settings |
50 | 45 |
|
51 | | -1. Open VS Code settings and search for "Roo browser" |
52 | | -2. Enable "Use remote browser connection" |
53 | | -3. Optionally enter a custom Chrome DevTools Protocol URL (for non-standard setups) |
54 | | -4. Click "Test Connection" to verify connectivity |
| 46 | +To access these settings: |
55 | 47 |
|
56 | | - |
| 48 | +1. Click ⚙️ in the top-right corner |
| 49 | +2. Navigate to `Browser / Computer Use` settings |
| 50 | +3. Check "Enable browser tool" |
| 51 | +4. Check "Use remote browser connection" |
| 52 | +5. Enter custom Chrome DevTools Protocol URL (optional) |
| 53 | +6. Click "Test Connection" to verify |
57 | 54 |
|
| 55 | +<img src={require('@site/static/img/remote-browser-connection/remote-browser-connection.png').default} alt="Remote Browser Connection Settings" width="700" /> |
58 | 56 |
|
59 | | -### 3. Setting Up DevContainer Integration |
| 57 | +### 3. Configure DevContainer Network (If Applicable) |
60 | 58 |
|
61 | | -If you're developing inside a container, you'll need to configure network access to reach the host machine: |
| 59 | +For container-based development, configure network access to reach the host machine: |
62 | 60 |
|
63 | 61 | For VS Code devcontainers, add this network configuration to your `devcontainer.json`: |
64 | 62 |
|
65 | 63 | ```json |
66 | | -"runArgs": [ |
| 64 | +{ |
| 65 | + "runArgs": [ |
67 | 66 | "--network=host" // Enables access to host's Chrome instance |
68 | | -] |
| 67 | + ] |
| 68 | +} |
69 | 69 | ``` |
70 | 70 |
|
71 | | -## Understanding How Connections Work |
72 | | - |
73 | | -After configuration, Roo establishes connections with Chrome using a sophisticated multi-step process to ensure reliability. |
74 | | - |
75 | | -When enabled, Roo connects to Chrome following this sequence: |
76 | | - |
77 | | -1. Attempts connection using your custom URL (if provided) |
78 | | -2. If unsuccessful, runs auto-discovery on localhost, Docker containers, and local network |
79 | | -3. Falls back to launching a local browser instance if all remote connection attempts fail |
| 71 | +## Connection Process |
80 | 72 |
|
81 | | -## Troubleshooting Connection Problems |
| 73 | +Roo connects to Chrome in this sequence: |
82 | 74 |
|
83 | | -If you encounter issues with the remote browser connection, here are solutions to the most common problems: |
| 75 | +1. Tries your custom URL (if provided) |
| 76 | +2. Runs auto-discovery on localhost, containers, and network |
| 77 | +3. Falls back to launching a local browser if all attempts fail |
84 | 78 |
|
85 | | -- **Connection Failed:** Verify Chrome is running with the correct debugging flag and port |
86 | | -- **Port Already in Use:** Change to an alternative port (e.g., `9333`) in both your Chrome launch command and Roo settings |
87 | | -- **Network Issues:** Ensure your container/VM network settings allow access to the Chrome host machine |
88 | | -- **Chrome Not Detected:** Check that firewall settings aren't blocking WebSocket connections |
89 | | -- **Permission Errors:** Make sure you have the necessary permissions to access the specified `--user-data-dir` location |
| 79 | +## Troubleshooting |
90 | 80 |
|
91 | | -## Exploring Advanced Capabilities |
| 81 | +| Problem | Solution | |
| 82 | +|---------|----------| |
| 83 | +| Connection Failed | Verify Chrome is running with `--remote-debugging-port=9222` | |
| 84 | +| Port Already in Use | Change to alternative port in both Chrome and Roo settings | |
| 85 | +| Network Issues | Check container/VM can access host machine | |
| 86 | +| Chrome Not Detected | Verify firewalls allow WebSocket connections | |
| 87 | +| Permission Errors | Ensure access to the specified `--user-data-dir` location | |
92 | 88 |
|
93 | | -For power users and advanced scenarios, Roo's remote browser connection includes several sophisticated features that enhance flexibility and reliability. |
| 89 | +## Advanced Capabilities |
94 | 90 |
|
95 | | -### How Auto-Discovery Works |
| 91 | +### Auto-Discovery |
96 | 92 |
|
97 | | -When no specific URL is provided, Roo automatically locates Chrome instances by searching: |
98 | | -- Standard debugging ports on localhost (9222, 9223) |
99 | | -- Running containers with debugging-enabled Chrome |
100 | | -- Network-accessible instances using discovery protocols |
| 93 | +When no URL is specified, Roo searches for Chrome instances across: |
| 94 | +- Standard debugging ports (9222, 9223) on localhost |
| 95 | +- Docker containers with debugging-enabled Chrome |
| 96 | +- Network-accessible instances via discovery protocols |
101 | 97 |
|
102 | | -### Understanding Automatic Fallback |
| 98 | +### Automatic Fallback |
103 | 99 |
|
104 | | -When remote connection attempts fail, Roo automatically launches a local browser instance, ensuring continuous workflow without manual intervention. |
| 100 | +When remote connections fail, Roo launches a local browser instance automatically to maintain workflow continuity. |
105 | 101 |
|
106 | | -### Alternative Setup: Using Chrome DevTools |
| 102 | +### Alternative Setup via Chrome DevTools |
107 | 103 |
|
108 | | -For situations where command-line configuration isn't ideal: |
| 104 | +For GUI-based configuration: |
109 | 105 |
|
110 | 106 | 1. Open `chrome://inspect` in Chrome |
111 | | -2. Click "Configure" next to "Discover network targets" |
| 107 | +2. Click "Configure" beside "Discover network targets" |
112 | 108 | 3. Add `localhost:9222` and click "Done" |
113 | | - |
114 | | -## Related Features |
115 | | - |
116 | | -Remote browser connection works seamlessly with other Roo features: |
117 | | - |
118 | | -- **[Custom Modes](custom-modes)**: Create specialized browser-based modes |
119 | | -- **[Code Actions](code-actions)**: Execute browser-based actions against remote instances |
120 | | -- **[Large Projects](large-projects)**: Improve performance by separating browser processes |
121 | | - |
122 | | -## Summary |
123 | | - |
124 | | -Remote browser connection provides flexibility for containerized development, custom browser profiles, and remote workflows. By following the setup instructions in this guide, you can leverage the power of an existing Chrome instance for your Roo sessions, making your development process more efficient and adaptable to various environments. |
0 commit comments