cdp-tunnel 2.6.2 → 2.7.0

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.
@@ -37,6 +37,7 @@ var LocalHandler = (function() {
37
37
  if (params && params.discover) {
38
38
  return getTargetInfos().then(function(targets) {
39
39
  targets.forEach(function(targetInfo) {
40
+ State.addEmittedTarget(targetInfo.targetId);
40
41
  EventBuilder.send('Target.targetCreated', { targetInfo: targetInfo });
41
42
  });
42
43
  return {};
@@ -435,8 +435,6 @@ function checkTabVisibility(tabId) {
435
435
  var isPreExisting = !isCDPCreated;
436
436
 
437
437
  Logger.info('[CDP] Emitting target:', targetId, 'tabId:', tabId, 'preExisting:', isPreExisting);
438
-
439
- EventBuilder.send('Target.targetCreated', { targetInfo: targetInfo });
440
438
 
441
439
  var attachLogic = function(attached) {
442
440
  var sessionId = CDPUtils.generateSessionId();
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "CDP Bridge",
4
- "version": "2.6.2",
4
+ "version": "2.7.0",
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.6.2",
3
+ "version": "2.7.0",
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",
@@ -755,12 +755,10 @@ function handlePluginConnection(ws, clientInfo, request) {
755
755
  const ns = getNamespace(ws);
756
756
  const cdpMsg = {
757
757
  method: parsed.method,
758
- params: parsed.params,
759
- type: 'event'
758
+ params: parsed.params
760
759
  };
761
760
  if (parsed.sessionId) {
762
761
  cdpMsg.params.sessionId = parsed.sessionId;
763
- cdpMsg.sessionId = parsed.sessionId;
764
762
  }
765
763
 
766
764
  if (parsed.method === 'Target.targetCreated') {
@@ -797,7 +795,6 @@ function handlePluginConnection(ws, clientInfo, request) {
797
795
  const discWs = clientById.get(discClientId);
798
796
  if (discWs && discWs.readyState === WebSocket.OPEN) {
799
797
  discWs.send(cdpData);
800
- console.log(`[TARGET EVENT DISCOVERED] ${parsed.method} targetId=${targetId?.substring(0,8)} -> discovering client=${discClientId}`);
801
798
  routedToDiscoverer = true;
802
799
  }
803
800
  } else {
@@ -1241,7 +1238,7 @@ function handleClientConnection(ws, clientInfo, customClientId = null, targetPlu
1241
1238
  }
1242
1239
  }
1243
1240
 
1244
- if (parsed && (parsed.method === 'Target.setDiscoverTargets' || parsed.method === 'Target.setAutoAttach')) {
1241
+ if (parsed && (parsed.method === 'Target.setDiscoverTargets' || parsed.method === 'Target.setAutoAttach')) {
1245
1242
  const ns = ws.pairedPlugin ? getNamespace(ws.pairedPlugin) : null;
1246
1243
  if (ns) {
1247
1244
  ns.discoveringClientIds.set(id, Date.now());