cdp-tunnel 1.5.1 → 1.6.1
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.
|
@@ -46,6 +46,7 @@ var SpecialHandler = (function() {
|
|
|
46
46
|
if (isAlreadyAttached) {
|
|
47
47
|
var newSessionId = CDPUtils.generateSessionId();
|
|
48
48
|
State.mapSession(newSessionId, tabId, targetId);
|
|
49
|
+
muteTabIfNeeded(tabId);
|
|
49
50
|
Logger.info('[CDP] Created additional session:', newSessionId, 'for tab:', tabId);
|
|
50
51
|
return { sessionId: newSessionId };
|
|
51
52
|
}
|
|
@@ -115,8 +116,6 @@ var SpecialHandler = (function() {
|
|
|
115
116
|
// 将标签页添加到CDP Automation组,使用对应的clientId
|
|
116
117
|
addTabToAutomationGroup(tab.id, clientId);
|
|
117
118
|
|
|
118
|
-
var targetId = String(tab.id);
|
|
119
|
-
State.addEmittedTarget(targetId);
|
|
120
119
|
getTargetIdByTabId(tab.id).then(function(targetId) {
|
|
121
120
|
return emitAutoAttachEvents(tab.id, targetId, browserContextId).then(function() {
|
|
122
121
|
resolve({ targetId: targetId });
|
|
@@ -129,7 +128,9 @@ var SpecialHandler = (function() {
|
|
|
129
128
|
function addTabToAutomationGroup(tabId, clientId) {
|
|
130
129
|
Logger.info('[TabGroup] Starting addTabToAutomationGroup for tabId:', tabId, 'clientId:', clientId);
|
|
131
130
|
|
|
132
|
-
|
|
131
|
+
setTimeout(function() {
|
|
132
|
+
muteTabIfNeeded(tabId);
|
|
133
|
+
}, 500);
|
|
133
134
|
|
|
134
135
|
var groupName;
|
|
135
136
|
var groupClientId = clientId;
|
|
@@ -204,6 +204,10 @@ var DebuggerManager = (function() {
|
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
if (method === 'Target.targetCreated' || method === 'Target.attachedToTarget' || method === 'Target.targetDestroyed') {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
|
|
207
211
|
var sessionId = State.findSessionByTabId(source.tabId);
|
|
208
212
|
Logger.info('[Event] method=' + method + ' tabId=' + source.tabId + ' sessionId=' + (sessionId || 'null'));
|
|
209
213
|
|