@tomflow/chatloop-extension 0.3.45 → 0.3.46
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/README.md +2 -0
- package/extension/background.js +10 -1
- package/extension/manifest.json +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -47,3 +47,5 @@ Clean 只清空输入框,不发送,不更改 Owner;必须指定精确标
|
|
|
47
47
|
详细接口和安全边界统一见 [Extension 产品文档](../../docs/extension.md)。
|
|
48
48
|
|
|
49
49
|
**新页准备超时策略(0.3.45)**:Start 新 Chat 编辑器只读等待约 218 秒,Handoff 新 Chat 只读等待约 234 秒,均保持一次新建/一次发送且不跳过 ChatGPT 网页验证。Start CLI 最多等待 310 秒,MCP Tools 转发最多 330 秒;Worker 对 Start/Handoff 的未确认资源等待 330 秒,其它 Action 维持 180 秒。窗口到期仍无确定回执时保留 BLOCKED,禁止自动重发。
|
|
50
|
+
|
|
51
|
+
**0.3.46 Chrome pendingUrl 修复**:Worker 创建正式 Action 时,以自己刚发起的受控 Extension URL 与 Chrome 返回的数值 tabId 登记资源,不能依赖 `tabs.create` 立即返回最终 `tab.url`(它可能仅有 `pendingUrl`)。Action 自身仍需验证真实 URL、Owner、token,任何未确认发送都不得重试;代码回归覆盖过渡 tab.url 缺失但单次 Action 正常创建。
|
package/extension/background.js
CHANGED
|
@@ -46,7 +46,16 @@ async function createBoundedAction(options) {
|
|
|
46
46
|
const quota=await resources.admit(await readRun(),{kind:'action'});
|
|
47
47
|
if (!quota.ok) throw Error(quota.code);
|
|
48
48
|
const tab=await chrome.tabs.create(options);
|
|
49
|
-
|
|
49
|
+
// MV3 tabs.create may return a tab with pendingUrl but no committed url.
|
|
50
|
+
// Register the exact Extension URL WE requested, not an about:blank
|
|
51
|
+
// transitional snapshot. The Action still checks its own actual source,
|
|
52
|
+
// token and Owner before any browser write.
|
|
53
|
+
if (!Number.isSafeInteger(tab?.id)||tab.id<=0
|
|
54
|
+
||typeof options?.url!=='string'
|
|
55
|
+
||!options.url.startsWith(chrome.runtime.getURL('')))
|
|
56
|
+
throw Error('ACTION_CREATED_ID_UNVERIFIED');
|
|
57
|
+
if (!await resources.registerAction({id:tab.id,url:options.url}))
|
|
58
|
+
throw Error('ACTION_RESOURCE_UNVERIFIED');
|
|
50
59
|
return tab;
|
|
51
60
|
}
|
|
52
61
|
const pathOf = url => {
|
package/extension/manifest.json
CHANGED