@tomflow/chatloop-extension 0.4.33 → 0.4.34
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/extension/manifest.json +1 -1
- package/lib/bridge.mjs +1 -1
- package/lib/browser-launch.mjs +8 -2
- package/package.json +1 -1
package/extension/manifest.json
CHANGED
package/lib/bridge.mjs
CHANGED
|
@@ -205,7 +205,7 @@ export function readRequest(id) {
|
|
|
205
205
|
const r=JSON.parse(readFileSync(p,'utf8'));
|
|
206
206
|
if(r.id!==id||!ACTIONS.includes(r.action)||Date.now()>r.expiresAt)
|
|
207
207
|
throw Object.assign(Error('Request expired or changed'),{code:'REQUEST_EXPIRED'});
|
|
208
|
-
if(['continue','handoff','clean','start','entry_test'].includes(r.action))validateIntent(r.action,r.intent);
|
|
208
|
+
if(['continue','handoff','clean','start','session','entry_test'].includes(r.action))validateIntent(r.action,r.intent);
|
|
209
209
|
if(r.traceParent!==undefined&&!validParent(r.traceParent))delete r.traceParent;
|
|
210
210
|
return r;
|
|
211
211
|
}
|
package/lib/browser-launch.mjs
CHANGED
|
@@ -69,9 +69,15 @@ export function openExtensionActionPage(url,{platform=process.platform,spawn=spa
|
|
|
69
69
|
if(platform!=='darwin')
|
|
70
70
|
throw Object.assign(Error('Browser launcher not yet verified on this OS'),
|
|
71
71
|
{code:'BROWSER_LAUNCH_UNSUPPORTED'});
|
|
72
|
-
|
|
72
|
+
// The private session Action uses a fixed operation selector in addition to
|
|
73
|
+
// its request locator. No other Action may accept arbitrary URL arguments.
|
|
74
|
+
const ordinary=/^chrome-extension:\/\/[a-p]{32}\/(?!session\.html)[a-z_]+\.html\?requestId=[a-f0-9]{32}$/;
|
|
75
|
+
const cancel=/^chrome-extension:\/\/[a-p]{32}\/session\.html\?requestId=[a-f0-9]{32}&operation=cancel$/;
|
|
76
|
+
if(!ordinary.test(url)&&!cancel.test(url))
|
|
73
77
|
throw Object.assign(Error('Untrusted Extension Action URL'),{code:'INVALID_ACTION_URL'});
|
|
74
|
-
|
|
78
|
+
// An orphaned Owner may have no Chat tab at all. The existing verified
|
|
79
|
+
// extension-details window is the only supported fallback for that case.
|
|
80
|
+
const entry=url.match(/^chrome-extension:\/\/([a-p]{32})\/(?:entry_test|session)\.html\?requestId=[a-f0-9]{32}(?:&operation=cancel)?$/);
|
|
75
81
|
const launchArgs=entry
|
|
76
82
|
?['-e',OPEN_TEST_ENTRY_WINDOW,url,'chrome://extensions/?id='+entry[1]]
|
|
77
83
|
:['-e',OPEN_IN_CHAT_WINDOW,url];
|