Skip to content

JS: File / Blob / FileReader browser APIs #345

Description

@mplsllc

Status

MacSurf has native file-input picking and browser-side upload plumbing, but the current QuickJS tree has no tracked implementation of the standard JavaScript Blob / File / FileReader surface. Repository search of the current workflow tree finds no corresponding implementation, while older loader code referenced only stub-era FileReader behavior.

This is a separate contract from <input type=file> multipart submission (#224): scripts need to inspect/read selected files and construct blob payloads even when no form submit occurs.

V1 scope

  • Blob construction from strings/ArrayBuffers/typed arrays with size, type, slice().
  • File as Blob + name / lastModified for user-selected files.
  • FileReader asynchronous readAsText and readAsArrayBuffer first; add data URL only if real-page evidence needs it.
  • load, error, abort, loadend lifecycle and readyState/result/error semantics.
  • Integrate <input type=file> selected-file objects with the JS surface without duplicating file bytes unnecessarily.

Object URLs (URL.createObjectURL) can be a follow-up if required.

Acceptance

A controlled page selects a local text file, sees a real File object, reads it as text and ArrayBuffer, receives exactly-once lifecycle events, and releases file/buffer resources on navigation. Also test a synthetic Blob without user file access. C89 and G3 hardware verification required.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: js-engineDuktape, ES5 evaluator, JS bindingsenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions