cdp-tunnel 3.0.7 → 3.0.9
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.
package/package.json
CHANGED
|
@@ -172,6 +172,13 @@ class PortPoolManager {
|
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
// 通知扩展有 client 连接(扩展需要 hasConnectedClient=true 才转发 debugger 事件)
|
|
176
|
+
const poolClientId = `pool_${session.portIndex}_${Date.now()}`;
|
|
177
|
+
pluginWs.send(JSON.stringify({
|
|
178
|
+
type: 'client-connected',
|
|
179
|
+
clientId: poolClientId
|
|
180
|
+
}));
|
|
181
|
+
|
|
175
182
|
// 合成输入命令需要 ensureVisible(和 forward.js 的逻辑一致)
|
|
176
183
|
const SYNTHETIC_INPUT = ['Input.dispatchKeyEvent', 'Input.dispatchMouseEvent'];
|
|
177
184
|
|
|
@@ -256,7 +263,6 @@ class PortPoolManager {
|
|
|
256
263
|
// 如果是 getTargets 响应,按 portIndex 过滤 targetInfos
|
|
257
264
|
if (pending && pending.method === 'Target.getTargets' && msg.result && msg.result.targetInfos) {
|
|
258
265
|
msg.result.targetInfos = msg.result.targetInfos.filter(t => session.targetIds.has(t.targetId));
|
|
259
|
-
console.log(`[PORT POOL] getTargets filtered: ${msg.result.targetInfos.length} targets for port ${session.port}`);
|
|
260
266
|
}
|
|
261
267
|
|
|
262
268
|
// 恢复原始 id,发给发起请求的 client
|