# Browser application

The built-in browser is the application `openprogram/programs/applications/browser/`. The core never imports it: the application's `setup(ctx)` provides the service `browser`, and every core caller looks it up with `_services.lookup("browser")` and runs without a browser when the lookup returns `None`.

| Module | Role |
| --- | --- |
| `__init__.py` | `setup`: provides the service and registers the L2 context section `pages`. The application registers no tool |
| `service.py` | `BrowserService`, the service's members (below) |
| `pages.py` | `BrowserResourceStore`, per-conversation Page projections, resource control, human page input |
| `tabs.py` | the [tab driver](https://fzkuji.github.io/OpenProgram/docs/reference/design/integrations/browser/tab-driver.html) for `computer_use(type="browser")` |
| `extension.py` | the user's Chromium browsers through the Playwright Extension, behind `computer_use(type="browser", app="chrome")`, `app="brave"`, …, and the entry for all user browsers (`connect`, `installed_browsers`) |
| `catalog.py`, `safari.py`, `firefox.py`, `script_page.py` | the browsers known and where each lives; Safari over Apple Events and Firefox over WebDriver BiDi, both on one injected page layer ([User browsers](https://fzkuji.github.io/OpenProgram/docs/reference/design/integrations/computer-use/user-browsers.html)) |
| `page_actions.py`, `file_inputs.py` | argument parsing and page scripts the two above share; the approved local file an upload sends |
| `app_endpoint.py`, `privacy.py` | the App's CDP endpoint; password-value redaction |
| `prompt.py` | the open-Pages section of a call's prompt |

The Agent operates the browsers with one tool, `computer_use`. The application registers no target itself: the provider `built_in_browser`, offered for `local`, looks the service up and yields the target `type="browser"`, the App's tabs through the tab driver, then `app="chrome"` and `app="edge"` for each of the user's browsers with the extension installed. Their actions are in [Browser tab actions](https://fzkuji.github.io/OpenProgram/docs/reference/design/integrations/browser/tab-actions.html).

The service's members are `pages`, `tabs`, `extension`, `open_tab(url)` and `authorized_page(arguments, window_id)`.

| Caller | Without the service |
| --- | --- |
| A call's prompt | No Pages section |
| Process routes | List no browser resources; 404 for browser control |
| Web tab bridge | Skips Page bookkeeping |
| `computer_use` | Lists no browser in `<devices>`; windows, the screen and other devices keep working |
| A Program's web tab commands | Refused with `browser_not_enabled` |

## A Program's web tabs

| Item |  |
| --- | --- |
| Open | `tabs.openWebTab` of the `framework` interface calls `open_tab(url)`: the tab opens in the background for the running conversation, as `create_tab` of `type="browser"` does. |
| Act | A native presentation command on a web tab names it with `arguments.tab`, the tab's id from `list_tabs` (omitted: the tab the conversation used last). `authorized_page` checks it against the App's current window and binding and sends the App its own tab id. |
| Authority | Both need what `computer_use` needs: a turn that may not use the screen tool may not reach a web tab this way either. |

## Implementation status

| State | Scope |
| --- | --- |
| Implemented | the built-in browser as the application `programs/applications/browser/`, reached only through the `browser` service, with tests for each caller running without it. |
| Implemented | one tool for the model, Programs and web tab commands: the tab driver behind `type="browser"`, the extension behind `app="chrome"` and `app="edge"`. |

[Computer and browser use](https://fzkuji.github.io/OpenProgram/docs/reference/design/integrations/computer-use/computer-and-browser-use.html)
