You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two behaviours from the dogfood run need isolation before any fix or guidance: (1) locator press on a nested iframe's body timed out while coordinate focus plus tab-level keyboard input worked, and lowercase f key presses did not advance a widget while uppercase F after refocusing did; (2) open custom dropdown menus sometimes vanished between calls, so option selection found no match until the menu was reopened and selected immediately.
Method
Owned fixture pages (nested iframe with a key listener; a custom listbox) served locally; serial calls through cua serve; test keyboard delivery by frame target and key case, and menu persistence across two consecutive calls with no user activity.
Deliverable
Findings comment with the reproduced or refuted behaviours and the resulting guidance (host notes or README) or a bug ticket against the vendor API usage in cua.
Spike #26 findings (2026-10-05, live run through cua serve, profile personal)
Setup. I served owned fixtures on 127.0.0.1:48761: a nested iframe (#outer > #inner) whose inner document logs keydown/keypress on body, on a div#widget[tabindex=0] and on the document, with event.key, code, keyCode, shiftKey, target, activeElement, hasFocus and visibilityState; and three custom listboxes. Listbox A closes on focusout, outside mousedown, visibilitychange and window blur, and logs which one fired. B closes on a 2 s timer. C closes only on toggle. The fixtures live outside the repo (job tmp). I opened one tab (tabs.new 80 ms, goto 366 ms), ran every js call serially, then closed the tab; end_task returned ended. The vendor opened the tab visible, and visibilityState read visible at every read. I did not touch any other tab to push it to the background, so hidden-tab behaviour was not exercised.
API cited from the browser document the first getBrowser returned: PlaywrightLocator.press(value, {timeoutMs}), pressSequentially(value, …), PlaywrightFrameLocator.frameLocator/locator, CUAAPI.click({x,y}), CUAAPI.keypress({keys}) ("press control characters at the current focused element (focus it first via click/dblclick)"), CUAAPI.type({text}).
1. Nested-frame keys: the timeout reproduced; "lowercase is broken" refuted
playwright_locator_press focuses the target through focusLocator → K1 (around line 56676) before sending the key. K1 calls focusNode and then requires expect(el, 'to.be.focused'), and it throws Element is not focused, which is retried until the 3 s deadline. A subframe's body cannot take focus, and that frame's document does not have focus, so the check never passes. The top-level body passes because it is already the active element of the focused document. The cause is therefore the vendor's strict focus check, not the frame depth and not the transport. The surfaced "selector deadline exceeded" with matchCount:1 hides the real reason. That is vendor diagnostics, which cua cannot change.
pressSequentially checks visible, enabled, editable (prepareSequentialInput), so it cannot drive a non-editable widget.
cua_type → Vi performs a clipboard paste, not key events, so it does nothing for key-driven widgets.
Key case follows Playwright semantics: f and F share code KeyF and keyCode 70. They differ only in event.key (and in the keypress charCode, 102 vs 70), and 'F' does not hold Shift.
The benchmark's T7 is consistent with this: it pressed on a focusable <input>.
The dogfood "lowercase f did nothing; refocus plus F worked" is best explained by focus. The lowercase presses went wherever focus was: the frame-body press timed out, and an unfocused cua.keypress lands in the top document. The refocus is what fixed it. Case matters only to a page that compares event.key case-sensitively, reads the keypress charCode, or checks shiftKey.
2. Disappearing custom menus: refuted as a cua/vendor effect under cua serve
Step
Result
Call 1: #btn-a.click() (628 ms)
A open at 01:14:18.2Z
Read-only calls after ~3.0 s, ~9.6 s and ~39 s of idle
A still open; no blur, focusout, visibilitychange or mousedown logged
Reopen A, then one call with tab.screenshot(), domSnapshot(), dom_cua.get_visible_dom(), dev.logs(), title()/url()
A open after each one
A further ~131 s of idle across calls
A still open; getByRole('option',{name:'Bravo'}).click() in that later call worked (1,066 ms)
Timer variant B: opened in one call, read 3.4 s later
closed with CLOSE by timer2s; the option click then fails with Locator diagnostics: {"kind":"no_matches", …, "matchCount":0}, the exact dogfood signature
Mechanism. On debugger attach the vendor enables Emulation.setFocusEmulationEnabled (enableFocusEmulation, around line 48116), so the page keeps hasFocus()===true and sees no window blur while the owner uses other apps. It detaches tabs only in detachTurn, which runs on turn_ended (around lines 64752 and 68043). cua sends turn_ended only from end_task or on connection close (src/mcp/task.mjs#beginEnding), so within one task nothing the backend does between calls removes focus from the page. The dogfood closures therefore came from the site (a timer, hover-out, a re-render after a slow load) or from a real visibility change (the tab hidden by the user or by the extension; the benchmark's pw-report shows the latter happening). Not verified here: hidden-tab behaviour, and whether a turn-end detach blurs the page. The second applies to the Codex/ChatGPT app, which ends a turn every model turn, not to cua serve.
Guidance
Host notes (src/mcp/surface.mjs, 2,035/2,048 characters). Replace two lines; the net change is +11, which gives about 2,046:
- Chrome tabs are DOM-only: act through tab.playwright locators, not native typeText/click. → - Chrome tabs are DOM-only: act through tab.playwright locators, not native typeText/click. Press keys on a focusable element, never a frame's body; tab.cua.type pastes, sending no keys.
The 3 s line → - Browser locator actions, waits and evaluate stop at 3 s (timeoutMs can only shorten it); to wait longer, loop short waits to your own deadline under a larger js timeout_ms.
The BROWSER_RULES 3 s pattern in test/mcp-browser-surface.test.mjs pins the old wording verbatim and would change with it.
README, browser troubleshooting:
"press('F') sends key "F" without Shift (Playwright semantics); use 'Shift+F' when the page checks shiftKey."
"An option locator reporting no_matches after a menu opened in an earlier call means the site closed it; cua keeps page focus between calls. Open and select in the same call."
No cua bug was found, so I am proposing no ticket. Side observation: the read-only evaluate world also lacks parseFloat and document.hasFocus, beyond the documented no fetch/require.
[board] done: Frame-body press fails on the vendor focus check (press a focusable element instead; cua.type pastes, so it sends no keys); menus are closed by the site, not cua (focus emulation holds until end_task). Host-note swap proposed, no cua bug.
Activity
SSFSKIM commentedon Oct 6, 2026
Spike #26 findings (2026-10-05, live run through
cua serve, profilepersonal)Setup. I served owned fixtures on
127.0.0.1:48761: a nested iframe (#outer>#inner) whose inner document logskeydown/keypressonbody, on adiv#widget[tabindex=0]and on the document, withevent.key,code,keyCode,shiftKey,target,activeElement,hasFocusandvisibilityState; and three custom listboxes. Listbox A closes onfocusout, outsidemousedown,visibilitychangeand windowblur, and logs which one fired. B closes on a 2 s timer. C closes only on toggle. The fixtures live outside the repo (job tmp). I opened one tab (tabs.new80 ms,goto366 ms), ran every js call serially, then closed the tab;end_taskreturnedended. The vendor opened the tab visible, andvisibilityStatereadvisibleat every read. I did not touch any other tab to push it to the background, so hidden-tab behaviour was not exercised.API cited from the browser document the first
getBrowserreturned:PlaywrightLocator.press(value, {timeoutMs}),pressSequentially(value, …),PlaywrightFrameLocator.frameLocator/locator,CUAAPI.click({x,y}),CUAAPI.keypress({keys})("press control characters at the current focused element (focus it first via click/dblclick)"),CUAAPI.type({text}).1. Nested-frame keys: the timeout reproduced; "lowercase is broken" refuted
frameLocator('#outer').frameLocator('#inner').locator('body').press('f')Playwright selector deadline exceeded; the diagnostics saymatchCount:1, visible:true, and no key event reaches the page{timeoutMs:1500}tab.playwright.locator('body').press('f')(top document)frameLocator('#outer').locator('body').press('f')(one level deep)inner.locator('[tabindex]').press('f')window.focusthenwidget.focus, then keydownkey="f" code=KeyF keyCode=70 target=div#widget#widget.press('F')/('Shift+f')/('Shift+F')/('f')'F'giveskey="F", keyCode 70,shiftKey=false.'Shift+f'and'Shift+F'give a Shift keydown, thenkey="F"withshiftKey=true#widget.pressSequentially('fF')h1.click(), thentab.cua.keypress({keys:['f']})tab.cua.click({x:132,y:179})on the widget, thencua.keypresswith['f'],['F'],['shift','f'],['SHIFT','F']div#widget, with the same key/shift semantics aspresstab.cua.type({text:'f'})/{text:'F'}Mechanism (vendor
@oai/browser-desktopbrowser-service.mjs, chatgpt-26.928.40906):playwright_locator_pressfocuses the target throughfocusLocator→K1(around line 56676) before sending the key.K1callsfocusNodeand then requiresexpect(el, 'to.be.focused'), and it throwsElement is not focused, which is retried until the 3 s deadline. A subframe'sbodycannot take focus, and that frame's document does not have focus, so the check never passes. The top-level body passes because it is already the active element of the focused document. The cause is therefore the vendor's strict focus check, not the frame depth and not the transport. The surfaced "selector deadline exceeded" withmatchCount:1hides the real reason. That is vendor diagnostics, which cua cannot change.pressSequentiallychecksvisible, enabled, editable(prepareSequentialInput), so it cannot drive a non-editable widget.cua_type→Viperforms a clipboard paste, not key events, so it does nothing for key-driven widgets.fandFsharecode KeyFandkeyCode 70. They differ only inevent.key(and in thekeypresscharCode, 102 vs 70), and'F'does not hold Shift.<input>.The dogfood "lowercase
fdid nothing; refocus plusFworked" is best explained by focus. The lowercase presses went wherever focus was: the frame-bodypresstimed out, and an unfocusedcua.keypresslands in the top document. The refocus is what fixed it. Case matters only to a page that comparesevent.keycase-sensitively, reads thekeypresscharCode, or checksshiftKey.2. Disappearing custom menus: refuted as a cua/vendor effect under
cua serve#btn-a.click()(628 ms)tab.screenshot(),domSnapshot(),dom_cua.get_visible_dom(),dev.logs(),title()/url()getByRole('option',{name:'Bravo'}).click()in that later call worked (1,066 ms)CLOSE by timer2s; the option click then fails withLocator diagnostics: {"kind":"no_matches", …, "matchCount":0}, the exact dogfood signatureMechanism. On debugger attach the vendor enables
Emulation.setFocusEmulationEnabled(enableFocusEmulation, around line 48116), so the page keepshasFocus()===trueand sees no window blur while the owner uses other apps. It detaches tabs only indetachTurn, which runs onturn_ended(around lines 64752 and 68043). cua sendsturn_endedonly fromend_taskor on connection close (src/mcp/task.mjs#beginEnding), so within one task nothing the backend does between calls removes focus from the page. The dogfood closures therefore came from the site (a timer, hover-out, a re-render after a slow load) or from a real visibility change (the tab hidden by the user or by the extension; the benchmark's pw-report shows the latter happening). Not verified here: hidden-tab behaviour, and whether a turn-end detach blurs the page. The second applies to the Codex/ChatGPT app, which ends a turn every model turn, not tocua serve.Guidance
Host notes (
src/mcp/surface.mjs, 2,035/2,048 characters). Replace two lines; the net change is +11, which gives about 2,046:- Chrome tabs are DOM-only: act through tab.playwright locators, not native typeText/click.→- Chrome tabs are DOM-only: act through tab.playwright locators, not native typeText/click. Press keys on a focusable element, never a frame's body; tab.cua.type pastes, sending no keys.- Browser locator actions, waits and evaluate stop at 3 s (timeoutMs can only shorten it); to wait longer, loop short waits to your own deadline under a larger js timeout_ms.The
BROWSER_RULES3 s pattern intest/mcp-browser-surface.test.mjspins the old wording verbatim and would change with it.README, browser troubleshooting:
press('F')sendskey"F" without Shift (Playwright semantics); use'Shift+F'when the page checksshiftKey."no_matchesafter a menu opened in an earlier call means the site closed it; cua keeps page focus between calls. Open and select in the same call."No cua bug was found, so I am proposing no ticket. Side observation: the read-only
evaluateworld also lacksparseFloatanddocument.hasFocus, beyond the documented no fetch/require.SSFSKIM commentedon Oct 6, 2026
[board] done: Frame-body press fails on the vendor focus check (press a focusable element instead; cua.type pastes, so it sends no keys); menus are closed by the site, not cua (focus emulation holds until end_task). Host-note swap proposed, no cua bug.
Merge pull request #44 from SSFSKIM/docs/spike26-guidance