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
|
|
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
|
}
|
package/package.json
CHANGED
package/server/proxy-server.js
CHANGED
|
@@ -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`);
|