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) {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "CDP Bridge",
4
- "version": "2.4.3",
4
+ "version": "2.4.4",
5
5
  "description": "Chrome DevTools Protocol Bridge for Playwright/Puppeteer automation",
6
6
  "permissions": [
7
7
  "debugger",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdp-tunnel",
3
- "version": "2.4.3",
3
+ "version": "2.4.4",
4
4
  "description": "Bridge Chrome's debugger API to WebSocket — control your existing browser with Playwright/Puppeteer via CDP",
5
5
  "main": "server/proxy-server.js",
6
6
  "bin": "./cli/index.js",
@@ -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'}`);