@adep/web-container 0.2.0 → 0.2.2

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.
@@ -28,9 +28,15 @@ export interface OfflineRunner {
28
28
  /**
29
29
  * 浏览器端 fetch 拦截器脚本(IIFE,纯 JS——必须能直接内联进 `<script>`,不能有 TS / ESM)。
30
30
  *
31
- * **同步纪律**:本字符串与 `shared/sdk/web-project-template.ts` 里 web/vite.config.ts 模板的
32
- * `FN_PROXY_SCRIPT` 必须**逐字一致**(两处复制粘贴,无共享 import——预览 iframe 与浏览器内
33
- * vite-dev 是两个独立加载上下文,共享一份源码反而会引入打包耦合)。改这里务必同步另一侧。
31
+ * **同步纪律**:本字符串与 `packages/vite-plugin/src/ide-proxy.ts`
32
+ * `FN_FETCH_INTERCEPTOR_SCRIPT`(单一真相源)必须**逐字一致**(两处复制粘贴,无共享
33
+ * import——预览 iframe 与浏览器内 vite-dev 是两个独立加载上下文,共享一份源码反而会引入
34
+ * 打包耦合)。改这里务必同步另一侧。
35
+ *
36
+ * blob base 兼容(2026-09-11 修复):浏览器内 vite-dev 预览文档的 baseURI 是 blob: URL,
37
+ * `new URL('/api/x', 'blob:…')` 抛 TypeError → 拦截器退化成原生 fetch 报
38
+ * "Failed to parse URL"。首次解析失败时用 `window.location.origin`(blob 继承创建者
39
+ * origin)兜底再解析一次。
34
40
  */
35
41
  export declare const FN_FETCH_INTERCEPTOR_SCRIPT: string;
36
42
  /** IDE 主线程侧的消息处理器类型:直接挂到 `window.addEventListener('message', handler)`。 */