@xcanwin/manyoyo 7.0.8 → 7.0.11

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.
package/lib/web/server.js CHANGED
@@ -4098,10 +4098,19 @@ function renderIndexHtml(ctx) {
4098
4098
  }
4099
4099
 
4100
4100
  function renderShadcnHtml(ctx) {
4101
- // shadcn 前端目前没有按会话动态改写 document.title 的逻辑,不需要 __MANYOYO_SERVE_TITLE__ 标记;
4102
- // shadcn.html 是 vite singlefile 打包产物,全部依赖内联成一个 <script>,用 .replace('</head>', ...)
4103
- // 有极小概率命中某个库源码里字面量出现的 "</head>",把注入脚本插进内联脚本中间导致整页解析错乱
4104
- return applyServeTitle(loadTemplate('shadcn.html'), ctx);
4101
+ // shadcn.html vite singlefile 打包产物,全部依赖内联成一个 <script>,
4102
+ // .replace('</head>', ...) 有极小概率命中某个库源码里字面量出现的
4103
+ // "</head>",把注入脚本插进内联脚本中间导致整页解析错乱;所以不复用
4104
+ // injectServeTitleFlag 那个 </head> 定位方式,改成跟 applyServeTitle 同款
4105
+ // 更窄、更安全的 <title> 定位,插一个 meta 标记告知前端跳过动态改写 document.title
4106
+ let html = applyServeTitle(loadTemplate('shadcn.html'), ctx);
4107
+ if (typeof ctx.serveTitle === 'string') {
4108
+ html = html.replace(
4109
+ /<\/title>/,
4110
+ () => '</title>\n <meta name="manyoyo-serve-title" content="1">'
4111
+ );
4112
+ }
4113
+ return html;
4105
4114
  }
4106
4115
 
4107
4116
  function renderLoginHtml(ctx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xcanwin/manyoyo",
3
- "version": "7.0.8",
3
+ "version": "7.0.11",
4
4
  "imageVersion": "1.9.1-common",
5
5
  "playwrightCliVersion": "0.1.18",
6
6
  "description": "AI Agent CLI Security Sandbox for Docker and Podman",