vg-coder-cli 2.0.70 → 2.0.72
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
|
@@ -524,28 +524,15 @@ function connect() {
|
|
|
524
524
|
} catch (e) { ack && ack({ ok: false, error: e.message }); }
|
|
525
525
|
});
|
|
526
526
|
|
|
527
|
-
// Dump extension metadata
|
|
528
|
-
//
|
|
529
|
-
//
|
|
527
|
+
// Dump extension metadata — version, installType, ID, permissions.
|
|
528
|
+
// Comes from window.vetgo.extInfo which background.ts injects when the
|
|
529
|
+
// controller script loads. (Page context has no chrome.runtime.* so
|
|
530
|
+
// we can't query at runtime — pre-injection is the only path.)
|
|
530
531
|
socket.on('worker:ext-info', async (_payload, ack) => {
|
|
531
532
|
try {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
}
|
|
535
|
-
const reply = await new Promise((resolve) => {
|
|
536
|
-
try {
|
|
537
|
-
chrome.runtime.sendMessage({ action: 'WORKER_EXT_INFO' }, (resp) => {
|
|
538
|
-
if (chrome.runtime.lastError) {
|
|
539
|
-
resolve({ ok: false, error: chrome.runtime.lastError.message });
|
|
540
|
-
return;
|
|
541
|
-
}
|
|
542
|
-
resolve(resp || { ok: false, error: 'no_response' });
|
|
543
|
-
});
|
|
544
|
-
} catch (err) {
|
|
545
|
-
resolve({ ok: false, error: err?.message || String(err) });
|
|
546
|
-
}
|
|
547
|
-
});
|
|
548
|
-
ack && ack({ ok: true, info: reply });
|
|
533
|
+
const info = (window.vetgo && window.vetgo.extInfo) || null;
|
|
534
|
+
if (!info) return ack && ack({ ok: false, error: 'extInfo not injected — extension may be outdated' });
|
|
535
|
+
ack && ack({ ok: true, info, tabUrl: location.href, vetgo: window.vetgo });
|
|
549
536
|
} catch (e) { ack && ack({ ok: false, error: e.message }); }
|
|
550
537
|
});
|
|
551
538
|
|