cdp-tunnel 2.7.1 → 2.7.3

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.
@@ -424,6 +424,11 @@ function checkTabVisibility(tabId) {
424
424
  var isOwnedByClient = isCDPCreated && State.getClientIdByTabId(tabId) === clientId;
425
425
  var otherClientOwns = isCDPCreated && !isOwnedByClient;
426
426
 
427
+ if (!isCDPCreated) {
428
+ Logger.info('[CDP] Skipping non-CDP (user) tab:', targetId, 'tabId:', tabId);
429
+ return;
430
+ }
431
+
427
432
  if (otherClientOwns) {
428
433
  Logger.info('[CDP] Skipping other-client tab:', targetId, 'tabId:', tabId);
429
434
  State.addEmittedTarget(targetId);
@@ -432,21 +437,13 @@ function checkTabVisibility(tabId) {
432
437
 
433
438
  State.addEmittedTarget(targetId);
434
439
  var targetInfo = LocalHandler.mapToTargetInfo(target);
435
- var isPreExisting = !isCDPCreated;
436
440
 
437
- Logger.info('[CDP] Emitting target:', targetId, 'tabId:', tabId, 'preExisting:', isPreExisting);
441
+ Logger.info('[CDP] Emitting CDP-owned target:', targetId, 'tabId:', tabId);
438
442
 
439
443
  var attachLogic = function(attached) {
440
444
  var sessionId = CDPUtils.generateSessionId();
441
445
  State.mapSession(sessionId, tabId, targetId);
442
446
 
443
- if (isPreExisting && clientId) {
444
- State.setTabIdToClientId(tabId, clientId);
445
- }
446
- if (isPreExisting) {
447
- State.addPreExistingTab(tabId);
448
- }
449
-
450
447
  if (config.waitForDebuggerOnStart) {
451
448
  State.addPendingDebuggerTab(tabId);
452
449
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "CDP Bridge",
4
- "version": "2.7.1",
4
+ "version": "2.7.3",
5
5
  "description": "Chrome DevTools Protocol Bridge for Playwright/Puppeteer automation",
6
6
  "permissions": [
7
7
  "debugger",
@@ -1,5 +1,5 @@
1
1
  var Config = {
2
- WS_URL: 'ws://localhost:19236/plugin',
2
+ WS_URL: 'ws://localhost:23297/plugin',
3
3
  RECONNECT_DELAY: 3000,
4
4
  DEBUGGER_VERSION: '1.3',
5
5
  HEARTBEAT_INTERVAL: 25000,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cdp-tunnel",
3
- "version": "2.7.1",
3
+ "version": "2.7.3",
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",
@@ -923,11 +923,9 @@ function handlePluginConnection(ws, clientInfo, request) {
923
923
  }
924
924
  if (mapping.isGetTargets && parsed.result && parsed.result.targetInfos) {
925
925
  const clientId = mapping.clientId;
926
- const pluginWsForGetTargets = ws;
927
926
  parsed.result.targetInfos = parsed.result.targetInfos.filter(t => {
928
927
  if (t.type !== 'page') return true;
929
928
  const ownerClient = ns.targetIdToClientId.get(t.targetId);
930
- if (!ownerClient) return true;
931
929
  return ownerClient === clientId;
932
930
  });
933
931
  console.log(`[GET TARGETS FILTERED] client=${clientId} returned ${parsed.result.targetInfos.filter(t => t.type === 'page').length} page targets`);