Open-source AI browser agent for Chrome and Firefox (monorepo) ðŸ§
JavaScript ai-agentai-agentsai-toolsbrowser-aibrowser-automationbrowser-extensionchrome-aichrome-devtoolschrome-extensionchrome-extensionsfirefox-addonfirefox-addonsfirefox-extensionfirefox-extensionsgemmagemma4minimaxoffline-aioffline-llmqwen
Vision mode: a Firefox drag runs HTML5 drag and drop for a draggable item
Emre Sokullu755ae5410a93
diff --git a/docs/vision-mode.md b/docs/vision-mode.mdindex bddb332de..800531726 100644--- a/docs/vision-mode.md+++ b/docs/vision-mode.md@@ -118,7 +118,7 @@ With an instant model the MV3 fixture's four steps (click and type, send, scroll`click_at` is rewritten into an ordinary coordinate `click` (`translateVisionClick`) before the batch pipeline runs, so the permission gate, the submit probe and every hard guard (recipient, deletion, money, credentials, publishing) inspect it like any other click. Only the final dispatch differs:- **Chrome**: trusted CDP pointer events at exactly the point (`_visionDispatchClick`), with the coordinate path's dispatch-time protections kept: a native `<select>` is focused for `type_text` instead of opening an OS popup no screenshot can show, the file-chooser guard, the recipient dispatch binding, `target=_blank` redirection into the run tab (also for a tab opened after the click returned, see Latency) and click-progress annotation. The legacy coordinate path's semantic re-targeting and nearby-input redirect are skipped: a vision click lands where the model pointed. Iframes, including cross-origin ones, receive the events natively.-- **Firefox**: no CDP, so `content.js` `visionInput` dispatches a synthetic pointer sequence at the exact point with real client coordinates, reproducing a press's focus (and its caret: a click in a text field or editable text puts the caret under the pointer) and a click's activation, moving off the element the pointer was last over the way a mouse does (out and leave events, so a hover menu that closes on mouseleave closes; a wheel moves the pointer to its point first and goes where the browser would send it: the nearest scroller that can still move that way, an exhausted one passing it on unless its `overscroll-behavior` keeps it, never a page locked with `overflow: hidden`, and from a frame that cannot scroll to the page around it), selecting the word under the pointer for a double click and its line (a textarea's line, a whole input, the text block) for a triple click, and entering same-origin iframes. The click runs inside the same native file-chooser guard as every agent click (`clickWithoutNativeFilePicker`), and the agent settles that guard afterwards, so a chooser opened a moment later is caught too. Dispatched events reach a disabled control's listeners, unlike a person's click (or `el.click()`), so a click or drag that would press a disabled control, disabled by its fieldset included, is refused before anything is sent (`disabled_control`). A drag gives every move and the release in the coordinates of the document under the point, so a slider in a same-origin frame reads one consistent path; its press focuses what it lands on and starts what a person's press would, since synthetic events alone neither move a native slider nor select text: on an `<input type=range>` the value under the pointer is set as the browser sets it (snapped to the step, an `input` event per change, `change` on release), and on selectable text or in a text field the text from the press to the pointer is selected (after a cancelable `selectstart`; not on links, images, draggable items, other controls or `user-select: none`). A click that must pass the recipient binding keeps the content click path. Cross-origin iframes receive the click on the frame element.+- **Firefox**: no CDP, so `content.js` `visionInput` dispatches a synthetic pointer sequence at the exact point with real client coordinates, reproducing a press's focus (and its caret: a click in a text field or editable text puts the caret under the pointer) and a click's activation, moving off the element the pointer was last over the way a mouse does (out and leave events, so a hover menu that closes on mouseleave closes; a wheel moves the pointer to its point first and goes where the browser would send it: the nearest scroller that can still move that way, an exhausted one passing it on unless its `overscroll-behavior` keeps it, never a page locked with `overflow: hidden`, and from a frame that cannot scroll to the page around it), selecting the word under the pointer for a double click and its line (a textarea's line, a whole input, the text block) for a triple click, and entering same-origin iframes. The click runs inside the same native file-chooser guard as every agent click (`clickWithoutNativeFilePicker`), and the agent settles that guard afterwards, so a chooser opened a moment later is caught too. Dispatched events reach a disabled control's listeners, unlike a person's click (or `el.click()`), so a click or drag that would press a disabled control, disabled by its fieldset included, is refused before anything is sent (`disabled_control`). A drag gives every move and the release in the coordinates of the document under the point, so a slider in a same-origin frame reads one consistent path; its press focuses what it lands on and starts what a person's press would, since synthetic events alone move no native slider, select no text and start no drag and drop: on an `<input type=range>` the value under the pointer is set as the browser sets it (snapped to the step, an `input` event per change, `change` on release), on selectable text or in a text field the text from the press to the pointer is selected (after a cancelable `selectstart`; not on links, images, draggable items, other controls or `user-select: none`), and on a `draggable="true"` item HTML5 drag and drop runs as the browser runs it (`dragstart` with a `DataTransfer` the page fills, `drag`/`dragenter`/`dragleave`/`dragover` per step, `drop` where the last `dragover` was accepted, `dragend`; no pointer or mouse events meanwhile). A click that must pass the recipient binding keeps the content click path. Cross-origin iframes receive the click on the frame element.Right before input goes out, both builds read what is under the pointer with `visionDomProbe` (`vision-dom-probe.js`), in an isolated world (Chrome, CDP) or the content-script world (Firefox), so page scripts cannot redefine the DOM methods it calls:@@ -152,7 +152,7 @@ npm run test:vision-mode- `test/vision-mode.mjs`: sizing, profiles, token formulas, diffs, micro changes, sessions, translation, tool surfaces of every tier in both builds, permission classification, prompt, the page-feedback policy for vision calls and the monitor's vision rebase.- `test/vision-mode-agent.mjs`: the real run loop in both builds (streaming and not) with a scripted vision model and a fake screen: first frame, tool surface, click translation, patches, "no visible change", new frames on navigation, pruning, stale and moved points, native tools, fallback to the tree; a refused click stopping its batch, tool and encoding failures, a failed first capture in a later run, a model switch between runs, drag/wheel/repeated-click refusals, `drag_at` on a protected messaging page; the settle wait on a caret or clock versus real motion; page churn before a decision (no tree read, nothing re-sent while the screen stays as seen, a change after the update shown, a person's input always reported); site notes in vision terms; a ledger workflow switching the run to the tree path; a drag after an earlier action of its batch re-checked at both ends; in Chrome, a click that opened no tab costing no poll, tabs opened at once or later being rerouted, and a late-tab watch staying armed past an update and rerouting a tab opened while the screen settled.- `test/monitor-vision-wheel.mjs`: the real page monitor in Chromium: two wheel notches fenced before their events arrive stay the agent's (a third, unfenced one is a person's), page churn does not void a prepared wheel, a person's click does.-- `test/vision-pipeline-browser.mjs`: Chromium at DPR 1/2/3 on a scrolled page: planned size, exact mapping, trusted clicks, diff regions, WebP vs JPEG; the Firefox content input path (caret placement, word and line selection, pointer transitions, wheel routing, drags in a same-origin frame, native range inputs, text selection, disabled controls, the file-chooser guard); the DOM probe on buttons, labelled text fields, focused number fields, selects, link cards, sliders and same-/cross-origin frames.+- `test/vision-pipeline-browser.mjs`: Chromium at DPR 1/2/3 on a scrolled page: planned size, exact mapping, trusted clicks, diff regions, WebP vs JPEG; the Firefox content input path (caret placement, word and line selection, pointer transitions, wheel routing, HTML5 drag and drop, drags in a same-origin frame, native range inputs, text selection, disabled controls, the file-chooser guard); the DOM probe on buttons, labelled text fields, focused number fields, selects, link cards, sliders and same-/cross-origin frames.- `test/quality/vision-mode-mv3.mjs` (`--dpr=2`, `--zoom=1.25`, `--scroll=100`, combinable): the installed MV3 extension with a loopback model that reads the frame labels and fills and submits a form with `click_at` and `type_text` (sent together in one response), scrolls with `scroll_at` and follows a `target=_blank` link; two colored markers (viewport-fixed and in the document) must appear in the first frame exactly where the label's scale puts them. The page reacts to the click's focus and a ticker changes it every 250 ms: typing must land on the first try, the wheel must scroll the page, the link's tab must become the run's tab with no extra tab left, no request may carry tree text, and until the link navigates every decision gets exactly one screen update and no browser-state message.The older MV3 quality fixtures script an accessibility-tree model (they answer with `ref_id`s read from `get_accessibility_tree`) under model names that WebBrain recognizes as vision-capable, so they seed `visionMode: 'off'` with their other settings. A new fixture that scripts tree tools needs the same line.@@ -161,6 +161,6 @@ The older MV3 quality fixtures script an accessibility-tree model (they answer w- File uploads (`upload_file`) and page-resource downloads by selector are not offered in vision mode; switch it off for those tasks. A click that would open a native file chooser is blocked in both builds and reported in those terms (`visionFilePickerBlockedResult`).- Closed shadow roots and canvas apps are reachable by pointer, but a native `<select>` popup is never visible in a screenshot: such a field is focused and `type_text` picks the option.-- HTML5 drag and drop driven only by `dataTransfer` may not react to synthetic or CDP pointer drags.+- HTML5 drag and drop: in Firefox a drag that starts on a `draggable="true"` item runs the drag-and-drop event sequence itself with a constructed `DataTransfer`; in Chrome the CDP pointer drag is left to the browser, as for `drag_drop`, so a page that relies only on `dataTransfer` may not react there.- A drag is not shown to the submit, money or publishing checks; it is refused when it would click a control, but a custom "slide to confirm" widget is only as safe as the page makes it.- Firefox input is synthetic (`isTrusted: false`); pages that require trusted events need Chrome.diff --git a/src/chrome/src/content/content.js b/src/chrome/src/content/content.jsindex fb3d13789..306de9e23 100644--- a/src/chrome/src/content/content.js+++ b/src/chrome/src/content/content.js@@ -1827,6 +1827,63 @@};}+ // An HTML5 draggable item (draggable="true") under a press starts the+ // browser's drag and drop, which synthetic pointer events never do. This+ // runs that sequence the way the browser does: dragstart on the item with+ // a DataTransfer the page fills (cancelled: no drag), then per pointer+ // step drag on the item, dragenter on a newly entered element (then+ // dragleave on the one left) and dragover on the current one, whose+ // cancelling makes it a drop target for its dropEffect; on release drop+ // there (or dragleave when nothing accepted it) and dragend on the item.+ // Null when no draggable item is under `el`.+ function _visionHtmlDrag(el) {+ const source = el?.closest?.('[draggable="true"]');+ const view = source?.ownerDocument?.defaultView;+ if (!view || typeof view.DragEvent !== 'function' || typeof view.DataTransfer !== 'function') return null;+ let transfer;+ try { transfer = new view.DataTransfer(); } catch { return null; }+ let current = null;+ let accepted = false;+ // Whether this engine lets a constructed DataTransfer carry a drop+ // effect (Chromium ignores it outside a real drag); without one, a+ // cancelled dragover alone makes the drop target.+ let effects = false;+ try { transfer.dropEffect = 'copy'; effects = transfer.dropEffect === 'copy'; transfer.dropEffect = 'none'; } catch { effects = false; }+ // The operation a dragenter or dragover starts from (HTML drag-and-drop+ // processing model), which the page may change before cancelling.+ const initialEffect = () => {+ const allowed = String(transfer.effectAllowed || 'uninitialized');+ return allowed === 'none' ? 'none' : allowed === 'move' ? 'move' : /^link/.test(allowed) ? 'link' : 'copy';+ };+ const fire = (target, type, init, cancelable = true) => target.dispatchEvent(new view.DragEvent(type, {+ bubbles: true, cancelable, composed: true, view, button: 0, buttons: 1, ...init, dataTransfer: transfer,+ }));+ const offer = (target, type, init) => {+ if (effects) transfer.dropEffect = initialEffect();+ return !fire(target, type, init) && (!effects || transfer.dropEffect !== 'none');+ };+ return {+ start: init => fire(source, 'dragstart', init),+ move(target, init) {+ fire(source, 'drag', init);+ if (target !== current) {+ offer(target, 'dragenter', init);+ if (current) fire(current, 'dragleave', { ...init, relatedTarget: target }, false);+ current = target;+ }+ accepted = offer(current, 'dragover', init);+ },+ end(init) {+ let handled = false;+ if (current && accepted) handled = !fire(current, 'drop', { ...init, buttons: 0 });+ else if (current) fire(current, 'dragleave', { ...init, buttons: 0 }, false);+ if (effects && !(current && accepted)) transfer.dropEffect = 'none';+ fire(source, 'dragend', { ...init, buttons: 0 }, false);+ return { started: true, dropped: !!(current && accepted), dropHandled: handled };+ },+ };+ }+// Where a caret would go at a point of `doc` (its client coordinates, kept// inside its viewport): { node, offset }, the node being the text field// itself when the point is in one.@@ -2076,6 +2133,11 @@}const range = pressAllowed ? _visionRangeDrag(el) : null;let selection = pressAllowed && !range ? _visionTextSelection(el) : null;+ // A draggable item starts HTML5 drag and drop at the first step+ // (_visionHtmlDrag); from then on, as for a person's drag, the page+ // gets drag events instead of pointer and mouse events.+ const html = pressAllowed && !range ? _visionHtmlDrag(el) : null;+ let htmlStarted = false;const pressOffsetX = x - cx;const pressOffsetY = y - cy;range?.to(cx, cy);@@ -2096,13 +2158,24 @@const py = y + (toY - y) * (i / steps);const at = _visionTargetAt(px, py);last = at?.el || last;- moveOnto(last, { button: 0, buttons: 1, ...pointAt(at, px, py) });+ const point = pointAt(at, px, py);+ if (html && i === 1) {+ htmlStarted = html.start(point);+ if (htmlStarted) pointer(el, 'pointercancel', { ...point, buttons: 0, cancelable: false });+ }+ if (htmlStarted) { html.move(last, point); continue; }+ moveOnto(last, { button: 0, buttons: 1, ...point });range?.to(px - pressOffsetX, py - pressOffsetY);selection?.to(px - pressOffsetX, py - pressOffsetY);}const end = _visionTargetAt(toX, toY);const releaseTarget = end?.el || last;const endInit = { button: 0, buttons: 0, ...pointAt(end, toX, toY) };+ if (htmlStarted) {+ const html5Drag = html.end(endInit);+ _visionPointerOver = releaseTarget;+ return { success: true, dispatched: true, method: 'synthetic-vision-drag', target: describe, html5Drag };+ }if (releaseTarget !== _visionPointerOver) moveOnto(releaseTarget, { ...endInit, buttons: 1 });pointer(releaseTarget, 'pointerup', endInit);mouse(releaseTarget, 'mouseup', { ...endInit, detail: 1 });diff --git a/src/firefox/src/content/content.js b/src/firefox/src/content/content.jsindex b19390ee0..9c9c95e0d 100644--- a/src/firefox/src/content/content.js+++ b/src/firefox/src/content/content.js@@ -2121,6 +2121,63 @@};}+ // An HTML5 draggable item (draggable="true") under a press starts the+ // browser's drag and drop, which synthetic pointer events never do. This+ // runs that sequence the way the browser does: dragstart on the item with+ // a DataTransfer the page fills (cancelled: no drag), then per pointer+ // step drag on the item, dragenter on a newly entered element (then+ // dragleave on the one left) and dragover on the current one, whose+ // cancelling makes it a drop target for its dropEffect; on release drop+ // there (or dragleave when nothing accepted it) and dragend on the item.+ // Null when no draggable item is under `el`.+ function _visionHtmlDrag(el) {+ const source = el?.closest?.('[draggable="true"]');+ const view = source?.ownerDocument?.defaultView;+ if (!view || typeof view.DragEvent !== 'function' || typeof view.DataTransfer !== 'function') return null;+ let transfer;+ try { transfer = new view.DataTransfer(); } catch { return null; }+ let current = null;+ let accepted = false;+ // Whether this engine lets a constructed DataTransfer carry a drop+ // effect (Chromium ignores it outside a real drag); without one, a+ // cancelled dragover alone makes the drop target.+ let effects = false;+ try { transfer.dropEffect = 'copy'; effects = transfer.dropEffect === 'copy'; transfer.dropEffect = 'none'; } catch { effects = false; }+ // The operation a dragenter or dragover starts from (HTML drag-and-drop+ // processing model), which the page may change before cancelling.+ const initialEffect = () => {+ const allowed = String(transfer.effectAllowed || 'uninitialized');+ return allowed === 'none' ? 'none' : allowed === 'move' ? 'move' : /^link/.test(allowed) ? 'link' : 'copy';+ };+ const fire = (target, type, init, cancelable = true) => target.dispatchEvent(new view.DragEvent(type, {+ bubbles: true, cancelable, composed: true, view, button: 0, buttons: 1, ...init, dataTransfer: transfer,+ }));+ const offer = (target, type, init) => {+ if (effects) transfer.dropEffect = initialEffect();+ return !fire(target, type, init) && (!effects || transfer.dropEffect !== 'none');+ };+ return {+ start: init => fire(source, 'dragstart', init),+ move(target, init) {+ fire(source, 'drag', init);+ if (target !== current) {+ offer(target, 'dragenter', init);+ if (current) fire(current, 'dragleave', { ...init, relatedTarget: target }, false);+ current = target;+ }+ accepted = offer(current, 'dragover', init);+ },+ end(init) {+ let handled = false;+ if (current && accepted) handled = !fire(current, 'drop', { ...init, buttons: 0 });+ else if (current) fire(current, 'dragleave', { ...init, buttons: 0 }, false);+ if (effects && !(current && accepted)) transfer.dropEffect = 'none';+ fire(source, 'dragend', { ...init, buttons: 0 }, false);+ return { started: true, dropped: !!(current && accepted), dropHandled: handled };+ },+ };+ }+// Where a caret would go at a point of `doc` (its client coordinates, kept// inside its viewport): { node, offset }, the node being the text field// itself when the point is in one.@@ -2370,6 +2427,11 @@}const range = pressAllowed ? _visionRangeDrag(el) : null;let selection = pressAllowed && !range ? _visionTextSelection(el) : null;+ // A draggable item starts HTML5 drag and drop at the first step+ // (_visionHtmlDrag); from then on, as for a person's drag, the page+ // gets drag events instead of pointer and mouse events.+ const html = pressAllowed && !range ? _visionHtmlDrag(el) : null;+ let htmlStarted = false;const pressOffsetX = x - cx;const pressOffsetY = y - cy;range?.to(cx, cy);@@ -2390,13 +2452,24 @@const py = y + (toY - y) * (i / steps);const at = _visionTargetAt(px, py);last = at?.el || last;- moveOnto(last, { button: 0, buttons: 1, ...pointAt(at, px, py) });+ const point = pointAt(at, px, py);+ if (html && i === 1) {+ htmlStarted = html.start(point);+ if (htmlStarted) pointer(el, 'pointercancel', { ...point, buttons: 0, cancelable: false });+ }+ if (htmlStarted) { html.move(last, point); continue; }+ moveOnto(last, { button: 0, buttons: 1, ...point });range?.to(px - pressOffsetX, py - pressOffsetY);selection?.to(px - pressOffsetX, py - pressOffsetY);}const end = _visionTargetAt(toX, toY);const releaseTarget = end?.el || last;const endInit = { button: 0, buttons: 0, ...pointAt(end, toX, toY) };+ if (htmlStarted) {+ const html5Drag = html.end(endInit);+ _visionPointerOver = releaseTarget;+ return { success: true, dispatched: true, method: 'synthetic-vision-drag', target: describe, html5Drag };+ }if (releaseTarget !== _visionPointerOver) moveOnto(releaseTarget, { ...endInit, buttons: 1 });pointer(releaseTarget, 'pointerup', endInit);mouse(releaseTarget, 'mouseup', { ...endInit, detail: 1 });diff --git a/test/vision-pipeline-browser.mjs b/test/vision-pipeline-browser.mjsindex 46054ee8a..1253a7bd4 100644--- a/test/vision-pipeline-browser.mjs+++ b/test/vision-pipeline-browser.mjs@@ -548,6 +548,66 @@ test('content-script vision wheel (Firefox path) scrolls what the browser would'}});+test('content-script vision drag (Firefox path) runs HTML5 drag and drop for a draggable item', async () => {+ const browser = await chromium.launch({ channel: 'chromium' });+ try {+ const page = await browser.newPage({ viewport: { width: 1000, height: 700 } });+ const at = (left, top) => `position:absolute;left:${left}px;top:${top}px;width:200px;height:60px;margin:0`;+ await page.setContent(`<!doctype html><style>body{margin:0}</style>+ <div id="a" draggable="true" style="${at(50, 50)};background:#fcc">A</div>+ <div id="b" draggable="true" style="${at(50, 150)};background:#cfc">B</div>+ <div id="c" draggable="true" style="${at(50, 250)};background:#ccf">C</div>+ <div id="zone" style="${at(400, 50)};height:200px;background:#eee"></div>+ <div id="plain" style="${at(400, 300)};background:#ddd"></div>+ <script>window.events=[];+ for(const id of ['a','b','c']){const el=document.getElementById(id);+ el.addEventListener('dragstart',e=>{if(id==='c'){e.preventDefault();return;}e.dataTransfer.setData('text/plain',id);e.dataTransfer.effectAllowed='move';events.push('dragstart:'+id)});+ el.addEventListener('dragend',()=>events.push('dragend:'+id))}+ const zone=document.getElementById('zone');+ zone.addEventListener('dragenter',e=>{e.preventDefault();events.push('dragenter:zone')});+ zone.addEventListener('dragover',e=>{e.preventDefault();e.dataTransfer.dropEffect='move'});+ zone.addEventListener('dragleave',()=>events.push('dragleave:zone'));+ zone.addEventListener('drop',e=>{e.preventDefault();const id=e.dataTransfer.getData('text/plain');events.push('drop:'+id);zone.append(document.getElementById(id))});+ for(const t of ['mousemove','mouseup'])document.addEventListener(t,()=>{if(events.at(-1)!==t)events.push(t)});</script>`);+ const source = fs.readFileSync(path.join(ROOT, 'src/firefox/src/content/content.js'), 'utf8');+ const block = source.slice(source.indexOf(' function _visionTargetAt('), source.indexOf(' let _lastClickIdent = null;'));+ const guardBlock = source.slice(source.indexOf(' function uniqueFileInputSelector(input) {'), source.indexOf(' /**\n * Click an element by selector or coordinates.'));+ await page.evaluate(({ code, guardBlock }) => {+ // eslint-disable-next-line no-new-func+ window.__visionInput = new Function(`function withLocalPageDispatch(callback) { return callback(); }+ function _uniqueFileInputSelector(input) { return input.id ? '#' + input.id : ''; }+ function _deepSelectorMatches(selector) { return [...document.querySelectorAll(selector)]; }+ ${guardBlock}\n${code}\nreturn visionInput;`)();+ }, { code: block, guardBlock });+ const run = params => page.evaluate(p => window.__visionInput(p), params);+ // Events from the drag's start on (the pointer arriving on the item moves the mouse first).+ const take = () => page.evaluate(() => {+ const all = window.events.splice(0);+ const start = all.findIndex(event => event.startsWith('dragstart') || event === 'mouseup');+ return start < 0 ? all : all.slice(start);+ });+ // A onto the drop zone: the page's drop handler moves it there; no mouse events while dragging.+ let result = await run({ type: 'drag', x: 150, y: 80, toX: 500, toY: 150, steps: 6 });+ assert.deepEqual(result.html5Drag, { started: true, dropped: true, dropHandled: true }, JSON.stringify(result));+ assert.deepEqual(await take(), ['dragstart:a', 'dragenter:zone', 'drop:a', 'dragend:a']);+ assert.equal(await page.evaluate(() => document.getElementById('a').parentElement.id), 'zone');+ // B onto an element that accepts no drop: no drop, the drag ends with no effect.+ result = await run({ type: 'drag', x: 150, y: 180, toX: 500, toY: 330, steps: 6 });+ assert.deepEqual(result.html5Drag, { started: true, dropped: false, dropHandled: false }, JSON.stringify(result));+ const missed = await take();+ assert.deepEqual(missed.filter(event => !event.startsWith('drag')), [], JSON.stringify(missed));+ assert.deepEqual(missed.filter(event => /^drag(start|end)|^drop/.test(event)), ['dragstart:b', 'dragend:b']);+ assert.notEqual(await page.evaluate(() => document.getElementById('b').parentElement.id), 'zone');+ // C cancels its dragstart: no drag starts and the pointer drag goes on as mouse events.+ result = await run({ type: 'drag', x: 150, y: 280, toX: 500, toY: 150, steps: 6 });+ assert.equal(result.html5Drag, undefined, JSON.stringify(result));+ const plain = await take();+ assert.ok(plain.includes('mouseup') && !plain.some(event => event.startsWith('drop')), JSON.stringify(plain));+ } finally {+ await browser.close();+ }+});+test('content-script vision clicks and drags (Firefox path) leave disabled controls alone', async () => {const browser = await chromium.launch({ channel: 'chromium' });try {