cdp-tunnel 2.2.0 → 2.2.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.
|
@@ -158,10 +158,10 @@ importScripts('features/automation-badge.js');
|
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
var openerTabId = tab.openerTabId;
|
|
161
|
-
var isOpenerControlled = openerTabId && State.isTabAttached(openerTabId);
|
|
161
|
+
var isOpenerControlled = openerTabId && State.isTabAttached(openerTabId) && !State.isPreExistingTab(openerTabId);
|
|
162
162
|
|
|
163
|
-
// 只有当 opener
|
|
164
|
-
//
|
|
163
|
+
// 只有当 opener 是 CDP 主动管理的 tab 时才跟踪新页面
|
|
164
|
+
// pre-existing tab 虽然也 attach 了 debugger,但属于用户 tab,不应继承 CDP 控制
|
|
165
165
|
if (!openerTabId) {
|
|
166
166
|
Logger.info('[Tabs] Tab has no opener, skipping. tabId:', tabId);
|
|
167
167
|
return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "CDP Bridge",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.2.1",
|
|
5
5
|
"description": "Chrome DevTools Protocol Bridge for Playwright/Puppeteer automation",
|
|
6
6
|
"permissions": [
|
|
7
7
|
"debugger",
|
|
@@ -33,8 +33,13 @@
|
|
|
33
33
|
},
|
|
34
34
|
"web_accessible_resources": [
|
|
35
35
|
{
|
|
36
|
-
"resources": [
|
|
37
|
-
|
|
36
|
+
"resources": [
|
|
37
|
+
"config-page-preview.html",
|
|
38
|
+
"config-page.js"
|
|
39
|
+
],
|
|
40
|
+
"matches": [
|
|
41
|
+
"<all_urls>"
|
|
42
|
+
]
|
|
38
43
|
}
|
|
39
44
|
]
|
|
40
45
|
}
|
package/package.json
CHANGED
package/server/proxy-server.js
CHANGED
|
@@ -672,16 +672,6 @@ function handlePluginConnection(ws, clientInfo) {
|
|
|
672
672
|
totalClients: clientConnections.size
|
|
673
673
|
});
|
|
674
674
|
|
|
675
|
-
logDisconnect('PLUGIN_DISCONNECTED', {
|
|
676
|
-
pluginId: id,
|
|
677
|
-
code, reason: reason?.toString() || 'none',
|
|
678
|
-
remainingPlugins: pluginConnections.size,
|
|
679
|
-
affectedClients: affectedClients.map(c => c),
|
|
680
|
-
uptime: ws.connectedAt ? `${((Date.now() - ws.connectedAt) / 1000).toFixed(0)}s` : 'unknown',
|
|
681
|
-
activeSessions: sessionToClientId.size,
|
|
682
|
-
pendingRequests: pendingAttachRequests.size
|
|
683
|
-
});
|
|
684
|
-
|
|
685
675
|
if (pluginConnections.size === 0) {
|
|
686
676
|
updateExtensionState(false);
|
|
687
677
|
}
|
|
@@ -709,6 +699,16 @@ function handlePluginConnection(ws, clientInfo) {
|
|
|
709
699
|
}
|
|
710
700
|
});
|
|
711
701
|
|
|
702
|
+
logDisconnect('PLUGIN_DISCONNECTED', {
|
|
703
|
+
pluginId: id,
|
|
704
|
+
code, reason: reason?.toString() || 'none',
|
|
705
|
+
remainingPlugins: pluginConnections.size,
|
|
706
|
+
affectedClients,
|
|
707
|
+
uptime: ws.connectedAt ? `${((Date.now() - ws.connectedAt) / 1000).toFixed(0)}s` : 'unknown',
|
|
708
|
+
activeSessions: sessionToClientId.size,
|
|
709
|
+
pendingRequests: pendingAttachRequests.size
|
|
710
|
+
});
|
|
711
|
+
|
|
712
712
|
if (affectedClients.length > 0) {
|
|
713
713
|
logConnectionEvent('PLUGIN_DISCONNECT_AFFECTED_CLIENTS', { pluginId: id, affectedClients });
|
|
714
714
|
}
|