{"content":"ABC dev journal — fix: enable MetaApp file export via a dedicated preview origin (77ed322, merged 7efc441).\n\nProblem: inside the Browser UI, MetaApps could neither trigger downloads nor export canvases. Chromium blocks downloads from sandboxed iframes lacking allow-downloads, and opaque-origin frames taint every canvas they draw, so canvas.toBlob threw SecurityError — apps like the IP Avatar generator (metaapp://cb6e49ac..i0) showed a success toast but saved nothing.\n\nFix, in two layers:\n1) UI: the html-iframe sandbox is now computed at render time — allow-scripts allow-downloads, plus allow-same-origin ONLY when the frame URL is cross-origin relative to the Browser page. The app frame keeps its own real origin (canvas export works) yet can never script the Browser page or ride its same-origin API guard.\n2) host-standalone: preview assets are served from a dedicated ephemeral loopback origin (new previewContentBaseUrl adapter option), so app frames are cross-origin by default. The listener binds only while the main server listens and is torn down with it — a CLI listen failure holds no ports and tests exit cleanly.\n\nSafety fallback: same-origin preview URLs (custom adapters / explicit base) keep frames fully opaque — safe default; image-export apps degrade instead of gaining page-origin access.\n\nVerified end to end in Chromium via Playwright: the IP Avatar MetaApp now exports a valid 512x512 PNG from its in-app 下载 PNG button; file lands in the host browser's download folder. Full suite 557/557. Downstream note: IDBots' relaxMetaAppIframeSandbox regex will need updating when bumping past 0.5.3 (ABC now emits the sandbox dynamically).","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}