Skip to content

fix(firefox): add buffered stdin fallback - #54

Merged
kbuffardi merged 5 commits into
mainfrom
fix/firefox-stdin-fallback
Jul 31, 2026
Merged

fix(firefox): add buffered stdin fallback#54
kbuffardi merged 5 commits into
mainfrom
fix/firefox-stdin-fallback

Conversation

@kbuffardi

Copy link
Copy Markdown
Owner

Summary

  • replace Firefox's SharedArrayBuffer-only run path with a validated interactive / buffered / none stdin contract
  • collect up to 256 KiB of pre-supplied stdin in an accessible dialog when live interactive stdin is unavailable
  • drain buffered bytes through WASI with correct repeated-read, iovec, UTF-8, and EOF semantics
  • keep Chromium live stdin unchanged while removing COOP/COEP keys from Firefox manifests
  • document the exact Firefox runtime acceptance procedure

Implementation follows the revised plan in issue #53: #53 (comment)

Validation

  • npm run test:e2e — 163 passed
  • npm run lint — passed
  • npm run build — passed; existing webpack bundle-size warnings only
  • npm run test:browser:firefox — passed packaging and web-ext lint (15 existing warnings)
  • npm audit --audit-level=high — reports 6 existing transitive advisories (1 moderate, 5 high); this change adds no dependencies and complete remediation includes a breaking copy-webpack-plugin upgrade

Browser QA still required

  • Run docs/firefox-stdin-runtime-acceptance.md in a real Firefox extension context and paste the requested evidence here.
  • npm run test:browser:chrome loaded the extension and WASM toolchain but did not reach the harness completion condition before timing out; Chromium behavior is otherwise covered by capability and run-contract regression tests.

Closes #53

Validate discriminated stdin modes at the worker boundary and let the WASI shim consume pre-supplied bytes with deterministic EOF. Preserve the existing SharedArrayBuffer path for interactive input.\n\nRefs #53
Make run preparation asynchronous and keep toolbar and terminal state consistent across submit, cancellation, duplicate actions, and failures. Add an accessible size-limited dialog while preserving Chromium live stdin.\n\nRefs #53
Treat Firefox compile and run as supported when SharedArrayBuffer is absent, remove unsupported isolation keys from Firefox manifests, and document the exact runtime acceptance required for cin.\n\nRefs #53
Share the 256 KiB contract between the UI and worker validator, reject oversized payloads at the worker boundary, and isolate dialog orchestration from terminal run state. Add regression coverage for oversized requests and the textarea cap.
Advance the manifest-driven project version for the Firefox buffered-stdin release PR and keep package metadata synchronized.

Copy link
Copy Markdown
Owner Author

Version bump applied and pushed in commit 37ec3af: the PR now targets 0.4.0 (0.4 semver release), synchronized across manifest.json, package.json, package-lock.json, dist/manifest.json, and dist-firefox/manifest.json.

Validation: npm run version:check and npm run release:check-version both pass.

@kbuffardi
kbuffardi marked this pull request as ready for review July 31, 2026 17:46
@kbuffardi
kbuffardi merged commit 2923a3a into main Jul 31, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: firefox error with cin permissions

1 participant