minecodex 0.1.3 → 0.1.4
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/package.json
CHANGED
|
@@ -141,9 +141,8 @@ Host 会再次发送当前状态。功能页面可据此暂停隐藏状态下的
|
|
|
141
141
|
|
|
142
142
|
- 只在 top frame 安装 Runtime,绝不向业务 iframe 注入 binding token。
|
|
143
143
|
- Watch / refresh 串行;已连接 Renderer 不重复连接,关闭 target 会清理状态。
|
|
144
|
-
- 本地 Surface 注入前先启用 CSP bypass
|
|
145
|
-
|
|
146
|
-
替换旧 Runtime,不刷新当前 Codex 页面。
|
|
144
|
+
- 本地 Surface 注入前先启用 CSP bypass,并为后续 document 注册 document-start 脚本;
|
|
145
|
+
当前 Codex document 始终直接注入或替换 Runtime,绝不通过 CDP reload Codex 页面。
|
|
147
146
|
- 入口由 Renderer 内的 MutationObserver 幂等挂载,React 重绘不会产生重复入口。
|
|
148
147
|
- Summary 根据对话主区域宽度连续派生 `overlay / shift / gutter`:小于 1096px
|
|
149
148
|
使用临时 Popover;1096–1535px 预留 316px 并把对话内容左移 158px;更宽时
|
|
@@ -3570,10 +3570,6 @@ function createDocumentBootstrapSource(source) {
|
|
|
3570
3570
|
return `window[${JSON.stringify(CSP_BOOTSTRAP_KEY)}] = ${CSP_BOOTSTRAP_VERSION};\n${source}`;
|
|
3571
3571
|
}
|
|
3572
3572
|
|
|
3573
|
-
function documentBootstrapExpression() {
|
|
3574
|
-
return `window[${JSON.stringify(CSP_BOOTSTRAP_KEY)}] === ${CSP_BOOTSTRAP_VERSION}`;
|
|
3575
|
-
}
|
|
3576
|
-
|
|
3577
3573
|
async function connect(url) {
|
|
3578
3574
|
const socket = new WebSocket(url);
|
|
3579
3575
|
const pending = new Map();
|
|
@@ -4198,20 +4194,9 @@ export class CodexRuntime {
|
|
|
4198
4194
|
bindingToken,
|
|
4199
4195
|
runtimeSessionId: this.runtimeSessionId,
|
|
4200
4196
|
});
|
|
4201
|
-
const bootstrapExpression = documentBootstrapExpression();
|
|
4202
4197
|
const script = await client.send("Page.addScriptToEvaluateOnNewDocument", {
|
|
4203
4198
|
source: createDocumentBootstrapSource(source),
|
|
4204
4199
|
});
|
|
4205
|
-
const documentWasBootstrapped = Boolean(evaluationValue(await client.send("Runtime.evaluate", {
|
|
4206
|
-
expression: bootstrapExpression,
|
|
4207
|
-
returnByValue: true,
|
|
4208
|
-
})));
|
|
4209
|
-
if (!documentWasBootstrapped) {
|
|
4210
|
-
const pageLoaded = client.waitFor("Page.loadEventFired", 20_000);
|
|
4211
|
-
await client.send("Page.reload");
|
|
4212
|
-
await pageLoaded;
|
|
4213
|
-
await waitForExpression(client, bootstrapExpression);
|
|
4214
|
-
}
|
|
4215
4200
|
await waitForExpression(
|
|
4216
4201
|
client,
|
|
4217
4202
|
`document.readyState === "interactive" || document.readyState === "complete"`,
|