fix: Download in a chat's frame that saves nothing opens a tab that saves the package, or says the way by hand (#114)
Closes #114.
In Grok the app's card plays an activity in the reply, but a press on Download .h5p did nothing and nothing was said. The play page left the save to the browser there, and the chat's frame dropped it. Nothing tells a page that its frame drops a download, so a framed page no longer counts on its own where the parent does not save for it.
What Download does now, framed by a parent that saves no file
| The parent | A press on Download | Under the stage |
|---|---|---|
| opens links, and the source names no file | hands the parent a link to a tab of this page, which builds the package and saves it with no further press, then closes itself | "A new tab builds your .h5p and saves it. No tab? Right-click Download, or press and hold it, and open the link in a new tab." |
| opens no links, or the source names a file | the browser is left to try, as before | "Nothing saved? Right-click Download, or press and hold it, and open the link in a new tab." |
A tab builds the same package only from a source that names no file. A file the package was built with is in the frame, chosen there or brought there, whatever address a preview played it from before: a tab would fetch that address again, for a file that may be another by now. The saving tab is the one a video too big for a chat's save already uses (#102, #104).
Unchanged: a tab of the page's own, where the browser saves the link; and a parent that saves files itself (ChatGPT), where the package is handed to it.
Both rows are the page's existing row under the stage. Looked at in light and dark, at 760 px and at a phone's 390 px: no scroller.
Testing
By hand, in a page that stands in for a chat: the app's card (h5p-toolkit main) in a frame sandboxed with no allow-downloads and no allow-popups, speaking MCP Apps, with this branch's build served locally.
- Before, with the live site: a parent that opens links, and one that opens none: a press saves nothing and says nothing. That is what was seen in Grok.
- After, in Chromium and Firefox:
- a parent that opens links: one press, the chat opens the tab, the tab saves
boiling-point.h5pand reaches its saved state; - a parent that opens none: the line above is said at the press;
- a parent that saves files: handed the package as before, "Saved. Look in your downloads."
- a parent that opens links: one press, the chat opens the tab, the tab saves
tscand the build are clean.
Not verified:
- Grok itself. Which of the two rows it gets depends on whether Grok opens links for a card, which is not known.
- WebKit: Playwright's WebKit does not take the stand-in chat's
http://127.0.0.1for a secure context, so the page builds nothing there, with or without this change.