cdp-tunnel 2.4.3 → 2.4.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.
|
@@ -24,6 +24,9 @@ var WebSocketManager = (function() {
|
|
|
24
24
|
State.clearReconnectTimer();
|
|
25
25
|
processQueue();
|
|
26
26
|
broadcastStateUpdate();
|
|
27
|
+
var extVersion = (typeof chrome !== 'undefined' && chrome.runtime && chrome.runtime.getManifest)
|
|
28
|
+
? chrome.runtime.getManifest().version : 'unknown';
|
|
29
|
+
send({ type: 'plugin-hello', version: extVersion });
|
|
27
30
|
};
|
|
28
31
|
|
|
29
32
|
ws.onclose = function(event) {
|
package/package.json
CHANGED
package/server/proxy-server.js
CHANGED
|
@@ -448,6 +448,21 @@ function handlePluginConnection(ws, clientInfo) {
|
|
|
448
448
|
logConnectionEvent('KEEPALIVE_RECEIVED', { type: 'plugin', id: ws.id });
|
|
449
449
|
return;
|
|
450
450
|
}
|
|
451
|
+
|
|
452
|
+
if (parsed && parsed.type === 'plugin-hello') {
|
|
453
|
+
const extVersion = parsed.version || 'unknown';
|
|
454
|
+
ws.extVersion = extVersion;
|
|
455
|
+
const match = extVersion === PKG_VERSION;
|
|
456
|
+
const level = match ? 'info' : 'warn';
|
|
457
|
+
const label = match ? '✅' : '⚠️ VERSION MISMATCH';
|
|
458
|
+
const msg = `[VERSION CHECK] ${label} server=${PKG_VERSION} extension=${extVersion}`;
|
|
459
|
+
console.log(msg);
|
|
460
|
+
logCDP('VERSION', msg);
|
|
461
|
+
if (!match) {
|
|
462
|
+
console.log(` ↳ Run "cdp-tunnel update" or reload the extension to sync versions`);
|
|
463
|
+
}
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
451
466
|
|
|
452
467
|
// 调试:打印所有收到的消息
|
|
453
468
|
console.log(`[PLUGIN MSG] id=${parsed?.id} method=${parsed?.method || 'none'} type=${parsed?.type || 'none'} sessionId=${parsed?.sessionId?.substring(0,8) || 'none'}`);
|