pmx-canvas 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1139,6 +1139,20 @@ function handleFrameDocument(pathname: string): Response {
1139
1139
  });
1140
1140
  }
1141
1141
 
1142
+ // Tiny always-200 document the client loads in a hidden iframe at boot to learn
1143
+ // whether this embedding context loads iframes from src URLs at all — nested
1144
+ // iframe hosts like the Amp orb portal block them, and the client then falls
1145
+ // back to fetch() + srcdoc surfaces (see src/client/state/iframe-mode.ts).
1146
+ function handleIframeProbe(): Response {
1147
+ return new Response('<!doctype html><title>pmx-canvas iframe probe</title>', {
1148
+ headers: {
1149
+ 'Content-Type': 'text/html; charset=utf-8',
1150
+ 'Cache-Control': 'no-store',
1151
+ 'Content-Security-Policy': 'sandbox allow-scripts',
1152
+ },
1153
+ });
1154
+ }
1155
+
1142
1156
  // ── Ext-app recovery diagnostics (0.3.2 report Finding N) ──────
1143
1157
  //
1144
1158
  // The WebKit black-tile recovery trail is otherwise trapped inside host panels
@@ -3011,10 +3025,19 @@ export function startCanvasServer(options: CanvasServerOptions = {}): string | n
3011
3025
  return handleCreateFrameDocument(req);
3012
3026
  }
3013
3027
 
3014
- if (url.pathname.startsWith('/api/canvas/frame-documents/') && req.method === 'GET') {
3028
+ // HEAD lets clients revalidate a minted frame URL after reconnect
3029
+ // (Finding S) without downloading the whole document.
3030
+ if (
3031
+ url.pathname.startsWith('/api/canvas/frame-documents/') &&
3032
+ (req.method === 'GET' || req.method === 'HEAD')
3033
+ ) {
3015
3034
  return handleFrameDocument(url.pathname);
3016
3035
  }
3017
3036
 
3037
+ if (url.pathname === '/api/canvas/iframe-probe' && (req.method === 'GET' || req.method === 'HEAD')) {
3038
+ return handleIframeProbe();
3039
+ }
3040
+
3018
3041
  if (url.pathname.startsWith('/api/canvas/surface/') && (req.method === 'GET' || req.method === 'HEAD')) {
3019
3042
  return handleNodeSurface(url.pathname, url);
3020
3043
  }