mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-10-23 00:35:23 +00:00
重新梳理Inject/Content的逻辑
This commit is contained in:
@@ -30,10 +30,12 @@ class Bridge implements TestClient {
|
||||
})
|
||||
|
||||
this.connect.onMessage.addListener((event, sender: chrome.runtime.Port) => {
|
||||
console.log(...this.terminal.message(JSON.stringify(event)));
|
||||
const data = PluginEvent.create(event);
|
||||
if (this.onMessage) {
|
||||
console.log(...this.terminal.chunkMessage(data.toChunk()));
|
||||
if (data.valid && this.onMessage) {
|
||||
this.onMessage(data, sender);
|
||||
} else {
|
||||
console.log(JSON.stringify(event));
|
||||
}
|
||||
});
|
||||
|
||||
|
@@ -395,7 +395,7 @@ export default defineComponent({
|
||||
bridge.send(Msg.TreeInfo, id);
|
||||
}
|
||||
function onChangeFrame() {
|
||||
const id = toRaw(frameID.value);
|
||||
const id = Number(toRaw(frameID.value));
|
||||
bridge.send(Msg.UseFrame, id);
|
||||
}
|
||||
const elLeft = ref<HTMLDivElement>();
|
||||
|
@@ -84,7 +84,7 @@ export default defineComponent({
|
||||
console.log(...t.red("red"));
|
||||
console.log(...t.green("green"));
|
||||
console.log(...t.blue("blue"));
|
||||
console.log(...t.chunk(event.toChunk()));
|
||||
console.log(...t.chunkMessage(event.toChunk()));
|
||||
},
|
||||
onTestTree() {
|
||||
const data: TreeData = {
|
||||
|
Reference in New Issue
Block a user