Skip to content
page

Codex control-in-app-browser

yaml
name: control-in-app-browser
description: "Control the in-app Browser. Use to open, navigate, inspect, test, click, type, screenshot, or verify local targets such as localhost, 127.0.0.1, ::1, file://, the current in-app browser tab, and websites shown side by side inside Codex."

Browser

Use this skill for browser automation tasks such as inspecting pages, navigating, testing local apps, clicking, typing, taking screenshots, and reading visible page state. After setup, select the iab browser.

Keep browser work in the background by default.

Show the browser when the user’s request is primarily to put a page in front of them or let them watch the interaction, such as “open localhost:3000”, “go to the docs page”, “take me to the PR”, “show me the current tab”, or “keep the browser open while you test checkout”.

Do not show the browser when navigation is only a means to answer a question or verify behavior, such as “check localhost:3000 and tell me whether login works”, “inspect the docs page and summarize what changed”, or “verify the modal still opens correctly”. Localhost targets and ordinary page navigation do not by themselves require visibility.

When the browser should be visible to the user, actually present it with await (await browser.capabilities.get("visibility")).set(true).

If this plugin is listed as available in the session, treat that as mandatory reading before browser work. Open and follow this skill before saying that Browser is unavailable and before falling back to standalone Playwright or Computer Use.

Do not skip this skill just because Computer Use MCP tool calls are directly visible or appear easier to invoke. The presence of Computer Use tools is not evidence that Computer Use is the preferred browser surface.

Start with the directions in the Bootstrap section below. Use await agent.documentation.get("<name>") when you need information about the specific topic they cover:

For example, this will give you guidance about confirmations:

js
console.log(await agent.documentation.get("confirmations"));

Bootstrap

These setup details are internal. User-facing progress updates should be less technical in nature. Never mention Node REPL, node_repl, REPL, JavaScript sessions, module exports, reading documentation, or loading instructions unless a user is asking for that exact information. If setup or recovery is needed, describe it naturally as connecting to the browser or retrying the browser connection.

The browser-client module is the core entry point for browser use, and is available under scripts/browser-client.mjs in this plugin’s root directory. ALWAYS import it using an absolute path. IMPORTANT: If this path cannot be found, stop and report that this plugin is missing scripts/browser-client.mjs. NEVER use the built in browser-client library.

Run browser setup code through the Node REPL js tool. In this environment the callable tool id typically appears as mcp__node_repl__js. If it is not already available, use tool discovery for node_repl js without setting a result limit. You need the js execution tool: js_reset only clears state, and js_add_node_module_dir only changes package resolution. Do not call either helper while trying to expose js. If js is still not available, search again for node_repl js with limit: 10. Run this once per fresh node_repl session:

js
const { setupBrowserRuntime } =
  await import("<plugin root>/scripts/browser-client.mjs");
await setupBrowserRuntime({ globals: globalThis });
globalThis.browser = await agent.browsers.get("iab");
nodeRepl.write(await browser.documentation());

Use the browser bound to browser for tasks in this skill.

The ability to interact directly with the browser is exposed through the browser-client runtime via the agent.browsers.* API. Before trying to interact with it, you MUST emit and read the complete documentation returned by await browser.documentation() in one go. For the initial documentation read, run the exact direct call nodeRepl.write(await browser.documentation()); shown above. Do not assign the documentation to a variable, inspect its length, slice it, truncate it, summarize it, or emit only an excerpt. Do not proactively split the documentation into pages or chunks. Only if the tool output itself explicitly reports that it was truncated may you emit and read smaller chunks until you have read the documentation in its entirety.

Only the Node REPL js tool (mcp__node_repl__js) can be used to control the in-app browser. Do not use external MCP browser-control tools, separate browser automation servers, or other browser skills for this surface. References to Playwright mean the in-skill tab.playwright API after browser-client setup.

API Use Behavior

How to use the API

General guidance

Browser Safety