Add an explicit host-authorized file upload bridge for sandbox scripts

Author: gwelinderCreated Aug 25, 2026Updated Aug 25, 2026

Use case

QuickJS browser scripts can call locator.setInputFiles, but they cannot read a local file safely because the sandbox has no Node filesystem access. Local UI acceptance therefore cannot exercise file inputs without bypassing the sandbox boundary.

Proposed behavior

Add an explicit host-mediated uploadFile(absolutePath) helper that:

  • accepts only files under the invoking process current working directory
  • rejects traversal and outside-root paths
  • transfers a bounded encoded payload through the existing protocol
  • returns the shape accepted by Playwright setInputFiles
  • includes protocol, allow/deny, exact-byte, and live sandbox coverage

I have a tested implementation on a fork branch, but am opening this issue first per the contribution guide and will wait for maintainer direction before submitting it.