diff --git a/skill-src/webcmd-browser/SKILL.src.md b/skill-src/webcmd-browser/SKILL.src.md index 3ab859ff..60de9aba 100644 --- a/skill-src/webcmd-browser/SKILL.src.md +++ b/skill-src/webcmd-browser/SKILL.src.md @@ -184,13 +184,13 @@ For CAPTCHA or raw user takeover, stop automation, give the user any viewer URL For native controls, inspect structure first, then use Playwright's normal form APIs inside `run`. Do not guess date formats, option labels, or file constraints from memory; read them from the DOM. -`browser run` uses QuickJS, not Node.js: `Buffer` and `TextEncoder` are unavailable. For an in-memory upload, pass bytes directly: +`browser run` uses QuickJS, not Node.js: `Buffer` is unavailable. For an in-memory upload, pass a `Uint8Array`; encode text with the supported `TextEncoder`: ```js await page.locator('input[type="file"]').setInputFiles({ name: 'evidence.txt', mimeType: 'text/plain', - buffer: new Uint8Array([102, 105, 108, 101]), + buffer: new TextEncoder().encode('file'), }); ``` diff --git a/skills/webcmd-browser/SKILL.md b/skills/webcmd-browser/SKILL.md index aa255efd..f972f5b7 100644 --- a/skills/webcmd-browser/SKILL.md +++ b/skills/webcmd-browser/SKILL.md @@ -184,13 +184,13 @@ For CAPTCHA or raw user takeover, stop automation, give the user any viewer URL For native controls, inspect structure first, then use Playwright's normal form APIs inside `run`. Do not guess date formats, option labels, or file constraints from memory; read them from the DOM. -`browser run` uses QuickJS, not Node.js: `Buffer` and `TextEncoder` are unavailable. For an in-memory upload, pass bytes directly: +`browser run` uses QuickJS, not Node.js: `Buffer` is unavailable. For an in-memory upload, pass a `Uint8Array`; encode text with the supported `TextEncoder`: ```js await page.locator('input[type="file"]').setInputFiles({ name: 'evidence.txt', mimeType: 'text/plain', - buffer: new Uint8Array([102, 105, 108, 101]), + buffer: new TextEncoder().encode('file'), }); ``` diff --git a/src/browser/run/runner.test.ts b/src/browser/run/runner.test.ts index f3284b20..a35796e9 100644 --- a/src/browser/run/runner.test.ts +++ b/src/browser/run/runner.test.ts @@ -20,6 +20,7 @@ import { } from 'playwright-core'; import { LocalBrowserRunArtifactSink } from './artifacts.js'; import { MemorySnapshotBaselineStore } from '../snapshot/index.js'; +import { MemorySnapshotBaselineStore } from '../snapshot/index.js'; import { unsupportedApiMessage } from './playwright-transport.js'; import { QuickJSHost } from './quickjs-host.js'; import { runBrowserProgram } from './runner.js';