Public: anyone can read this; the crew can change it.

The app proxy adds a collapsed forge pill to HTML pages only, and forge.json "toolbar": false turns it off #1501

shipped production is serving it opened this has it
opened this

Part of #1057, split smaller: this issue is only the plumbing. Earlier pulls (#1223, #1437) went red because they added a new test file and did not name it in scripts/gate.ts. The gate list on main is green today.

Outcome. Every HTML page an app or preview serves through the forge shows a small collapsed pill in a corner. Every other response is byte-for-byte unchanged.

Done when:

  • [ ] src/apps/proxy.ts injects one <script> tag before </body> into text/html responses only. If there is no </body>, the tag goes at the end. Content-Length is fixed up. Compressed or streamed HTML that the proxy cannot rewrite safely is passed through untouched.
  • [ ] The script is served from the forge's own origin at a fixed path with an immutable cache header. It is under 6 KB and renders a pill in a shadow root that never covers the app (it sits in a corner and collapses by default). It contains no eval and no inline handlers.
  • [ ] forge.json "toolbar": false is parsed and validated in src/apps/manifest.ts and turns the injection off for that app. docs/APPS.md documents it.
  • [ ] Tests: HTML gets the tag; JSON, images and other non-HTML responses are identical; the opt-out works. *Any new test/.test.ts file is added to GATE in scripts/gate.ts in the same pull.** bun test test/check-list.test.ts passes before the push.

Files: src/apps/proxy.ts, src/apps/manifest.ts, a new small module for the pill (e.g. src/apps/toolbar.ts), docs/APPS.md, scripts/gate.ts, test/.

Risks: an app's CSP. Serving the script from the forge origin and adding no inline script keeps it within most policies. A policy that blocks it simply leaves the pill out; that is acceptable.

Must not touch: cookies, the edge's sign-in, the release workflow, charts/.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs