Repository navigation
Local Cloak browser-run does not forward transient filechooser events #448
Description
Activity
I tried to reproduce this against the real local Cloak runtime (cloakbrowser 0.4.5, Chromium 146.0.7680.177.5, headed persistent context) and the file chooser turns out to be fine — it's the first line of the program that hangs.
Running your program unchanged reproduces the timeout. Changing only
page.setContent(...)topage.goto('data:text/html,' + encodeURIComponent(html))and leaving the rest identical:A) direct Playwright on Cloak : "evidence.pdf" B) through browser run : ok, "evidence.pdf"So
filechooseris forwarded through the bridge,FileChooser.setFilesworks with in-memory payloads, and the input being removed right afterclick()is not a problem.What fails is
page.setContent(), which on Cloak applies the markup and then never resolves:[stock chromium] setContent: RESOLVED 11ms | console ev: ["log:main-log","debug:main-debug"] [cloak humanize:on] setContent: HUNG 8005ms | content landed: "hi" | console ev: [] [cloak humanize:off] setContent: HUNG 8005ms | content landed: "hi" | console ev: []Cloak's Chromium accepts
Runtime.enablebut never emitsRuntime.consoleAPICalled. Playwright resolvesFrame.setContenton aconsole.debug(<tag>)sentinel it writes from the utility world next todocument.write, so the promise never settles. Your program spends its whole budget on statement one, which is why it looked like afilechoosertimeout — and why the control passed: withplaywright-coreand a stock Chromium,setContentresolves normally. That also explains why Cloak 0.5.9 made no difference; it is the browser binary, not the wrapper.Workaround today: navigate to the markup instead of setting it.
await page.goto('data:text/html,' + encodeURIComponent(html));
#528 makes browser run say this instead of
Split the task into a smaller run or increase --timeout, which is the part that currently sends you back around the same 30s wall. It does not makesetContentwork — that needs a fix in Cloak's Chromium.One side effect worth noting separately: because those console events never arrive,
page.on('console')also never fires on the default runtime, so page-sideconsole.logis silently dropped in browser run. Happy to open that as its own issue if useful.- added a commit that references this issue
on Sep 13, 2026 Correction to the workaround I posted above, and an upstream link.
This is a known CloakBrowser bug — CloakHQ/cloakbrowser#360, opened 2026-06-07. Cloak-HQ confirmed and root-caused it to the browser binary's DevTools layer and said a fix was going into the next binary build. It is still open, and I've confirmed it still reproduces on the current binary (
146.0.7680.177.5, wrapper0.4.5).They publish a better workaround than the
data:URL I suggested — it keeps the page on its current origin instead of navigating away, which matters if you are mid-session on a real site:await page.evaluate((h) => { document.open(); document.write(h); document.close(); }, html); await page.waitForLoadState('load');
I verified this end to end through
browser runon real Cloak with your exact program: it completes in 21ms, leavespage.url()untouched, and the file chooser then resolves toevidence.pdf.#528 has been updated to point at this recovery rather than the
data:URL.- added a commit that references this issue
on Sep 25, 2026
Summary
webcmd browser runcannot receive afilechooserevent from the local Cloak runtime, so an in-memory upload cannot be supplied to transientinput[type=file]controls such as Flutter Webfile_picker.Reproduction
Environment:
Create an isolated browser session and run this program:
Expected
The program receives the file chooser and reports
evidence.pdf. File payloads remain in memory; host filesystem paths are not needed.Actual
The program times out waiting for
filechooser(the overall browser-run limit is reached when no shorter timeout is supplied).Control
The equivalent regression runs successfully in Webcmd's
runBrowserProgramtest withplaywright-core; the failure occurs only through the real local Cloak runtime bridge. Updating Cloak from 0.4.5 to 0.5.9 did not change the result.Requested behavior
Forward
Page.filechooserthrough the local Cloak browser-run bridge so callers can use the existingFileChooser.setFilesAPI with in-memory payloads, including inputs that are removed immediately afterclick().