mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-11-03 16:35:25 +00:00
重构background对port的管理,彻底修复多标签页面数据相互串的bug
This commit is contained in:
@@ -22,7 +22,9 @@ class Bridge implements TestClient {
|
||||
}
|
||||
this._inited = true;
|
||||
if (CCP.Adaptation.Env.isChromeRuntime) {
|
||||
this.connect = chrome.runtime.connect({ name: Page.Devtools });
|
||||
// 调试的标签ID
|
||||
const id = chrome.devtools.inspectedWindow.tabId;
|
||||
this.connect = chrome.runtime.connect({ name: `${Page.Devtools}-${id}` });
|
||||
this.connect.onDisconnect.addListener(() => {
|
||||
debugLog && console.log(...this.terminal.disconnect(""));
|
||||
this.connect = null;
|
||||
|
||||
Reference in New Issue
Block a user