Skip to content

Studio: let models use the browser panel - #13372

Merged
danielhanchen merged 37 commits into
mainfrom
studio-browser-use-tools
Oct 12, 2026
Merged

danielhanchen merged 37 commits into
mainfrom
studio-browser-use-tools

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

What this does

Chat models can now drive the browser panel beside the chat. Turn on Browser use from the composer's + menu: a Browser pill appears, and the model gets browser tools. It opens pages in its own tab in the panel, reads them, clicks, types, picks options and scrolls while you watch. Local GGUF models, safetensors/MLX models and external API providers all use the same tools, because every tool loop already goes through execute_tool.

Tools (core/inference/browser_agent.py): browser_navigate (also back, forward, reload), browser_snapshot, browser_find, browser_click, browser_type, browser_select, browser_scroll, browser_press_key. There is also browser_screenshot, which is offered only to vision models in the desktop app, where the panel can be captured without a share prompt.

Settings > Browser

A new Browser use section at the top of the Browser settings:

  • Let models use the browser. Turns browser use on or off. It is the same switch as the composer's Browser pill.

  • Browsing history. Choose whether models can read your history through a new browser_history tool: Always ask (the default), Always allow, or Never. With Never, the tool isn't offered at all.

  • Agent permissions. A default, plus exceptions for sites or patterns (example.com, *.example.com), with three columns:

    • Browsing: Always allow, Ask for new sites (the default) or Requires approval, or Blocked. A Blocked default means the agent may open only the sites you allowed.
    • Actions: sign-ins, form posts, and buttons that buy, send or delete. Requires approval (the default) or Always allow.
    • Downloads: Requires approval (the default), Always allow, or Blocked. This applies to downloads from the agent's tab while a chat run is using it; afterwards the tab follows the user's own download settings.

    Password, card and one-time-code fields are never filled, whatever these settings say. A site added here starts as Always allow for browsing, with the action and download prompts kept. Stored values are checked when loaded, so a bad value falls back to the default rather than to allow.

The existing link, download, history and annotation settings already cover the rest of the reference layout. Some items in the reference don't apply to Studio's browser:

  • password manager, contact info and autofill;
  • extensions;
  • camera and microphone site settings;
  • WebMCP site tools;
  • CDP access, which is deliberately left out.

How it works

  • The model reads the page as text, not screenshots. This is the approach browser-use, Playwright MCP, agent-browser and Chrome DevTools MCP all share. Each visible element is one line with a stable ref:

    [r4] searchbox "Search models"
    [r9] combobox "Size" selected="Small" options: Small | Medium | Large
    

    By default only the visible part of the page is read, capped at about 8k characters. full_page, browser_find and scrolling reach the rest. Refs stay the same until the page navigates. A stale ref returns an error that tells the model to read the page again. Each action returns the updated page, so one step is one model turn. This works for small text-only models.

  • The page script (features/browser/agent/page-agent.ts) is the same on both surfaces:

    • in the proxied frame (web Studio, Linux Desktop, older macOS), through a new agent command in the frame's boot();
    • in desktop native views, through a new browser_view_agent Tauri command. It uses the same template and eval_with_callback pattern as annotate and is gated by require_main.
  • The tool loop runs on the server, and the browser lives in the tab. A browser tool sends its request to the tab as a tool_output frame carrying browser_action; tool_stream_exec now passes dicts through. The chat tab runs the action and answers on POST /api/inference/browser-action-result. The tool waits for that answer the way it waits on tool approvals (state/browser_actions.py):

    • the id is unguessable and scoped to the session and account;
    • the first answer wins;
    • Stop or a disconnect ends the wait.

    Turns with browser tools use the live-tab stream (BROWSER_EXECUTED_TOOLS), which was reserved for this case.

  • Off by default. The tools are never part of the default catalog: they are offered only when the chat names them in enabled_tools, and only to requests that take Studio's UI frames (an API client could never answer them).

Safety

The browser runs the model's actions; it does not trust the model. These rules are enforced in code, since prompt injection will sometimes work on small models:

  • Addresses are checked twice.

    • On the server: only http(s), only public hosts (name, IP literal and DNS checks, the same resolver check the fetch tools use), and the request's website policy, checked before every navigation and again on the page the action ended on.
    • In the panel: a new site needs the user's OK unless the user named it (the exact host, or the site's name on .com/.org/.net/.edu/.gov), the user already approved it in this chat, or the current page links to that exact address. Following a link doesn't approve its site for addresses the model makes up. An address the model made up, with data in it, therefore can't leave quietly. Host checks ignore a trailing dot (evil.com. is evil.com).
  • The panel asks before consequential actions, in every permission mode:

    • signing in (forms with a password);
    • submitting POST forms;
    • buttons that buy, pay, send, post, delete, subscribe, sign in or accept.

    The agent bar above the page says exactly what the action is and where the form goes, with Allow, Deny and Stop. If the user declines, the model is told and the action does not run.

  • Some fields are never filled:

    • the agent never types into password, card, CVC or one-time-code fields, nor uploads files;
    • the model is told to ask the user to do it.
  • Hidden text and labels don't reach the model. display:none, aria-hidden, 1px screen-reader text and text under 2px (font-size:0) are left out of the snapshot.

  • Page text is fenced as untrusted. It is wrapped in <untrusted_web_content>, and the page cannot close the fence. The tool descriptions tell the model that page text is data, not instructions.

  • The agent works only in its own tab. The model can't reach the user's other tabs. The proxied frame keeps no cookies, so on the web build the agent is always logged out.

Verified

  • Backend: tests/test_browser_agent.py (30 tests) covers:

    • argument and address checks: localhost, private, metadata and .local hosts, file:/javascript:, credentials in URLs, website policy;
    • the round trip, including scoping by session and account, Stop and timeouts;
    • the fence, the screenshot image envelope;
    • that the tools are offered only when named;
    • that the stream wrapper delivers actions in order while leaving the tool result unchanged.

    Existing streaming, permission and approval tests pass.

  • Frontend: typecheck, the full npm test suite, npm run build, i18n:check:strict and bundle:check (within budget). tests/browser-agent-gate.test.ts covers the gates.

  • Page script: run against a fixture page in Playwright Chromium and WebKit. Both pass the same checks:

    • hidden text left out, labels and options read correctly;
    • typing reaches React-style inputs, submit, select, checkbox, custom role buttons;
    • links handed back for navigation, find below the visible area, scrolling;
    • stable refs, a stale-ref error, and a page script cannot replace the installed agent.
  • Desktop: cargo test for the new command's script splicing.

  • End to end on CPU in an isolated Studio, with unsloth/gemma-4-E2B-it-GGUF (UD-Q4_K_XL):

    • Web UI: "Open news.ycombinator.com and tell me the title of the top story" opens Hacker News in the panel and answers from it.
    • Form flow: "go to html.duckduckgo.com/html, search for unsloth studio" types the query. The search form is a POST, so the agent bar asks before submitting. Allow submits and the answer comes from the results; Deny stops the submit and the model is told.
    • Through the API (GGUF loop and external-provider loop): the same model, reached as an OpenAI-compatible llama.cpp provider, drives the same tools. A prompt-injection line in the page text was ignored.

Screenshots (web UI, gemma-4-E2B-it-GGUF on CPU)

The model opened Hacker News in the panel and answered from the page:

Hacker News read by the agent

The search form posts, so the agent bar asks before submitting it:

Form submit confirmation

With Browsing history on Always ask, browser_history waits for the user:

History access prompt

Not tested here

  • Desktop native views (WKWebView on macOS 14+, WebView2 on Windows): only compiled and unit-tested on this host. The script itself ran in WebKit through Playwright.
  • browser_screenshot, which needs the desktop app and a vision model.
  • Safetensors/MLX chat: it calls the same execute_tool and stream wrapper, but no GPU is available here.

Known limits

  • The agent script shares the page's JavaScript world (native views and the proxied frame alike), so a hostile page can feed it false answers about its own content, including the element facts the action prompts rely on. Its error messages are limited to the agent's own wording, so a page can't use them to talk to the model outside the fence. Running it in an isolated world (WKContentWorld, or WebView2 through DevTools) is a follow-up.
  • Clicks are synthetic DOM events, so a few sites that check isTrusted won't react.
  • A page that only works with its own cookies or passes a bot check still fails in the proxied frame, as it does for the panel today.

Before / after (merge base 2640084 vs head aedb68c)

Composer + menu: the head build lists Browser use under Chat with files (MCP moved under More); the merge base has no such item.

Composer + menu before and after

Settings > Browser: the head build opens with the new Browser use section (the switch, Browsing history, Agent permissions with defaults Ask for new sites / Requires approval / Requires approval). The switch shows on only because the menu item was clicked first in the same run; it is the same setting.

Settings > Browser before and after

Browser tools (navigate, snapshot, find, click, type, select, scroll, press key, screenshot) that any tool loop can call: GGUF, safetensors/MLX and external API providers. The chat tab runs each action in the agent's tab of the browser panel and posts the result back; the panel asks the user before sign-ins, POST forms, purchases and new sites, and never types into password or payment fields.
Settings > Browser gains a Browser use section: turn browser use on or off, choose whether models may read the browsing history (always ask, always allow, never; a new browser_history tool), and Agent permissions with a default and per-site rules for browsing, actions (sign-ins, form posts, purchases) and downloads. Password and payment fields stay off-limits whatever the rules say.
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 12, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 12, 2026
shimmyshimmer added a commit to shimmyshimmer/unsloth-staging-4 that referenced this pull request Oct 12, 2026
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-12T13:45:50.695978Z cbe1a86 Manual request
🔒 Security Review ✅ Completed 2026-10-12T11:14:39.477493Z cd36c24 Manual request

Security findings

Advisory findings (3)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2acd463ff5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +396 to +399
url = _one_line(_clip(result.get("url"), _MAX_URL_CHARS))
if url.lower().startswith(("http://", "https://")) and website_policy:
allowed, _reason, host = check_url_access(url, website_policy)
if not allowed:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Revalidate public resolution for browser results

On desktop native views, a hostname is resolved by the backend before the action but then resolved independently by the WebView; a DNS-rebinding host can therefore pass the initial public-address check and subsequently resolve to a private service. This result-side check runs only for a nonempty website policy and only calls the domain-policy validator, which does not reject private DNS results, so the local page contents are returned to the model. Reapply the public-host resolver check to every final HTTP(S) result before formatting its content.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not reachable: native requests go through browser_proxy.rs, which resolves the host itself and refuses private answers, and the proxied path pins the resolved IP, so a rebinding answer after the check never connects.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

Gate Enter/Space on buttons and cross-site form actions, re-check the landing site after redirects, honour submitter formaction/formmethod, redact card and secret field values, skip hidden elements in find, keep refs unique across pages, fence the page title, stop the running action on Stop, size the tab's deadline from the backend wait and retry result posts.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

Recheck the page's site before every read or action, gate checkbox selects and Enter/Space on submit buttons, submit on Enter only from text fields, find password fields joined with form=, build control names from visible text, keep page words out of errors, mask secret fields in screenshots, expire queued actions from receipt, give each page a non-overlapping ref range, and apply the initiating site's download rule.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex security review

Ask before following a link whose href is read at click time, submit Enter through the button the gate described, read headings from visible text, keep site-name approval off shared hosts and partial host matches, hold Backspace/Delete to the typing rules, and recognise consequential labels in Studio's UI languages.
chatgpt-codex-connector[bot]

This comment was marked as resolved.

… site matching

- A page script's error text reached the model outside the untrusted fence. The panel now
  sends it as pageError and the server fences it.
- WebKit acts on a synthetic Enter keypress (implicit submit, button click), so Enter in a
  field or on a button ran twice there. press() now skips its own action when the key
  already submitted or clicked.
- A trailing dot (evil.com.) slipped past blocked site rules and the website policy on
  link, redirect and form paths.
- Naming a site ("search wikipedia") no longer approves a lookalike on another TLD
  (wikipedia.xyz) without asking.
- example.com vs *.example.com on a subdomain no longer depends on save order.
Pass only the page agent's own fixed error messages to the model, judge a dropdown change by the option chosen, and ask before Backspace or Delete outside a text field.
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 12, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 12, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 12, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 12, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 12, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 12, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 12, 2026
danielhanchen pushed a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Oct 12, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 12, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Oct 12, 2026
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0042bf9a04

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

const shown = wholePage || onScreen(rect);
const role = roleOf(el);
if (role) {
if (sized(rect) || role === "checkbox" || role === "radio") {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exclude hidden controls from full-page snapshots

When full_page is true, shown is unconditionally true, and this size exception assigns refs to zero-sized checkboxes and radio buttons whose ancestor has display: none (the descendant's own computed display is not necessarily none). The model can then call browser_select on that ref, and choose() ultimately invokes click() programmatically despite the control being invisible, potentially changing conditional or internal form state the user cannot see. Check ancestor visibility or otherwise exclude zero-sized controls before emitting these refs.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not reproducible: walk() returns at hidden(el, style) before recursing, so nothing under a display:none ancestor is visited or given a ref. Checked in Chromium with fullPage: a checkbox inside a display:none div gets no ref; the zero-size exception only applies to visible custom-styled checkboxes and radios, which is its purpose.

}
// A native move starts when the view reports it; loading from now, so the wait below sees it.
if ((nativeMove || (native && action.op === "reload")) && hasNativeView(tab.id)) store.updateTab(tab.id, { loading: true });
if (nativeMove) nativeAction(tab.id, action.op as "back" | "forward");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Block native history moves with unknown destinations

In a desktop native view, Back or Forward can point to history created before the current agent trail, so destination is empty and this branch substitutes a generic user prompt before still calling nativeAction. The destination therefore loads without being checked against action.policy or a site rule; arrive() only withholds the result after the blocked host has already received the request. This is especially reachable when a first-turn chat is re-keyed and enterScope() clears trail, so unknown native-history moves should be refused unless their URL can be validated before navigation.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below the bar: with no known destination the move already asks the user first (Open the previous page?), the entry is history the user made in that tab, and arrive() still withholds a blocked page from the model. Refusing outright would only remove the user's choice.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d2517b1118

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1258 to +1262
elif (
self._deduplicate_tool_calls
and key in self._successful_keys
and tool_name not in BROWSER_TOOL_NAMES
):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Deduplicate mutating browser calls within one tool batch

When deduplicate_tool_calls is enabled, this exempts every browser tool, including browser_click, browser_select, and browser_type with submit, rather than only state-dependent reads and scrolling. If a model emits the same mutating call twice in one assistant turn, the second call is prepared after the first succeeds and the frontend queue executes it again, even though the model has not observed any intervening page state; this can toggle a setting twice or submit/purchase twice. Preserve deduplication for mutating browser operations within a single batch while still allowing deliberate repeats after a later observation.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intended: browser calls are exempt from identical-call collapsing because each acts on the page as it is then (two scrolls are two scrolls), and the textual-fallback collapse now matches the structured path, which never collapsed. A repeated click is not a silent repeat of a consequential action: buy, send, delete, sign-in and POST submits each ask in the agent bar, every time.

Comment on lines +1447 to +1448
# A browser call acts on the page as it is then: two scrolls are two scrolls.
elif _key in seen_keys and _fn.get("name") not in BROWSER_TOOL_NAMES:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Continue browser nudges after safetensors tool turns

The safetensors/MLX loop special-cases browser calls only for deduplication, while its no-call nudge still requires that no tool has ever executed (safetensors_agentic.py:1293). After the first browser action, a model response such as “I’ll click the result” without an actual call is therefore accepted as the final answer and the browsing task stops, whereas the GGUF path added a per-browser-turn post-tool nudge reset specifically for this case. Apply the same bounded post-tool browser nudge behavior on this backend.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below the bar for this PR: nothing runs wrongly; a model that announces a step without calling it ends its turn and the user can say continue. Matching the GGUF per-browser-turn nudge budget in the safetensors loop is a follow-up that needs a safetensors browser run to tune.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cbe1a864fe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if ((tag === "textarea" || tag === "input") && (field.disabled || field.readOnly)) {
return { ok: false, error: `${ref} is disabled or read-only.` };
}
if (tag === "textarea" || (tag === "input" && TEXT_INPUTS.has(field.type.toLowerCase()))) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Support date-like inputs in browser_type

For <input type="date"> and the related time, datetime-local, month, and week types, roleOf() exposes the control to the model as a textbox, but this condition rejects it because TEXT_INPUTS omits those types. On common booking and scheduling forms, the model therefore receives a valid ref yet browser_type always reports that it is not a text field; accept these native input types and set their correctly formatted values.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #13429 (60ca06e): date, time, datetime-local, month and week inputs are typed into, and an unparseable value returns the expected format instead of success.

Comment on lines +535 to +536
const position = getComputedStyle(node).position;
if (position === "fixed" || position === "sticky") return node;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject clicks covered by absolute overlays

When an element is obscured by an absolutely positioned modal, popover, or other in-page overlay, elementFromPoint() returns the covering element but this loop only treats fixed or sticky ancestors as overlays. It consequently returns null and the subsequent programmatic el.click() activates a control that the user could not click at that location; reject unrelated hit-test results regardless of whether the covering layer uses absolute, while retaining explicit exceptions for labels or styled controls.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not changing: treating any absolutely positioned layer over the target as a cover would refuse ordinary clicks, since styled checkboxes, labels and icon overlays commonly sit on top of their control as absolute siblings. Fixed and sticky layers are the modal case the hit test is for.

Comment on lines +748 to +750
el.value = option.value;
el.dispatchEvent(new Event("input", { bubbles: true }));
el.dispatchEvent(new Event("change", { bubbles: true }));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Refuse selections on disabled dropdowns

For a disabled native <select>, this branch writes its value and dispatches input and change events without checking el.disabled. Unlike a real user interaction, browser_select can therefore change a locked control and trigger application handlers even though the snapshot marks it disabled; return the existing disabled/read-only error before mutating the selection.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #13429 (60ca06e): a disabled select returns the disabled error before any value or event changes.

Comment on lines +367 to +370
const answer = await pageCall(tab, op);
if (!answer.ok) return { ok: false, error: answer.error ?? "the page could not be read." };
if (op.op === "snapshot" || op.op === "find") pageLinks = new Set(answer.links ?? []);
const fresh = useBrowserStore.getState().tabs.find((candidate) => candidate.id === tab.id) ?? tab;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Recheck the page after awaiting an observation

If the tab starts an automatic or user-initiated navigation after stillAllowed() but while pageCall() is awaited, the call can install on and snapshot the newly loaded document; this function then returns that document's text and fresh URL without running arrive() or stillAllowed() for the new site. Consequently a browser_snapshot or browser_find can expose a site that the user's browsing rules require approving or block entirely, so compare the URL/document after the call and gate it before returning the answer.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in #13429 (fff724a): a snapshot or find whose tab is loading or on another URL after the read returns an error instead of the text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants