cdp-tunnel 2.5.16 → 2.5.17
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
package/server/proxy-server.js
CHANGED
|
@@ -210,8 +210,10 @@ async function requestVersionFromPlugin() {
|
|
|
210
210
|
if (msg.id === requestId && msg.result) {
|
|
211
211
|
clearTimeout(timeout);
|
|
212
212
|
plugin.off('message', handler);
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
if (msg.result.product || msg.result.userAgent) {
|
|
214
|
+
cachedBrowserVersion = msg.result;
|
|
215
|
+
}
|
|
216
|
+
resolve(cachedBrowserVersion || msg.result);
|
|
215
217
|
}
|
|
216
218
|
} catch (e) {}
|
|
217
219
|
};
|
|
@@ -624,6 +626,8 @@ function handlePluginConnection(ws, clientInfo) {
|
|
|
624
626
|
if (!match) {
|
|
625
627
|
console.log(` ↳ Run "cdp-tunnel update" or reload the extension to sync versions`);
|
|
626
628
|
}
|
|
629
|
+
cachedBrowserVersion = null;
|
|
630
|
+
requestVersionFromPlugin();
|
|
627
631
|
return;
|
|
628
632
|
}
|
|
629
633
|
|
|
@@ -782,7 +786,16 @@ function handlePluginConnection(ws, clientInfo) {
|
|
|
782
786
|
clientWs.send(msgStr);
|
|
783
787
|
console.log(`[ATTACHED EVENT] Sent cached event to client: ${mapping.clientId}`);
|
|
784
788
|
}
|
|
785
|
-
|
|
789
|
+
const newTargetInfo = cachedCreated?.parsed?.params?.targetInfo
|
|
790
|
+
|| cachedEvent?.parsed?.params?.targetInfo;
|
|
791
|
+
if (newTargetInfo) {
|
|
792
|
+
const exists = cachedTargets.some(t => t.targetId === targetId);
|
|
793
|
+
if (!exists) {
|
|
794
|
+
cachedTargets.push(newTargetInfo);
|
|
795
|
+
}
|
|
796
|
+
} else {
|
|
797
|
+
invalidateTargetsCache();
|
|
798
|
+
}
|
|
786
799
|
}
|
|
787
800
|
// 过滤 Target.getTargets 响应,只返回该客户端拥有的 target
|
|
788
801
|
if (mapping.isGetTargets && parsed.result && parsed.result.targetInfos) {
|