@devries-cameron20 / t3code Mirror · read-only / commits / 4ab3b98411
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 11:00 UTC

fix(shared): MCP apps that fall back to a blob: frame no longer render blank (#32129)

Jason Lernerman committed Nov 15, 2026 at 00:01 UTC 4ab3b984112f6f1b9544ff4d92dd0a6f2b2005bf
2 files changed +10 -2
packages/shared/src/mcpApp.test.ts
+6 -1
@@ -18,10 +18,15 @@ describe("mcpAppContentSecurityPolicy", () => {
18 const policy = mcpAppContentSecurityPolicy(undefined);
19 expect(policy).toContain("default-src 'none'");
20 expect(policy).toContain("connect-src 'none'");
21 - expect(policy).toContain("frame-src 'none'");
21 + expect(policy).toContain("frame-src blob:;");
22 expect(policy).not.toContain("'self'");
23 });
24
25 + it("lets apps frame their own blob: documents alongside declared frame origins", () => {
26 + const policy = mcpAppContentSecurityPolicy({ frameDomains: ["https://embed.test"] });
27 + expect(policy).toContain("frame-src blob: https://embed.test;");
28 + });
29 +
30 it("allows exactly the declared origins", () => {
31 const policy = mcpAppContentSecurityPolicy({
32 connectDomains: ["https://api.weather.test"],
packages/shared/src/mcpApp.ts
+4 -1
@@ -177,7 +177,10 @@ export function mcpAppContentSecurityPolicy(csp: McpAppCsp | undefined): string
177 `font-src data: ${resources}`.trim(),
178 `media-src data: blob: ${resources}`.trim(),
179 `connect-src ${list(csp?.connectDomains, "'none'")}`,
180 - `frame-src ${list(csp?.frameDomains, "'none'")}`,
180 + // A blob: frame holds HTML the app already has and inherits its opaque
181 + // origin, sandbox and policy. Apps whose own embed can't load from an
182 + // opaque origin fall back to one.
183 + `frame-src blob: ${csp?.frameDomains?.join(" ") ?? ""}`.trim(),
184 "object-src 'none'",
185 `base-uri ${list(csp?.baseUriDomains, "'none'")}`,
186 "form-action 'none'",