mirror of
https://github.com/tidys/cc-inspector-chrome
synced 2025-10-23 00:35:23 +00:00
添加了一些log
This commit is contained in:
@@ -9,6 +9,7 @@ class Content {
|
||||
private connect: chrome.runtime.Port | null = null;
|
||||
|
||||
constructor() {
|
||||
console.log("init content");
|
||||
// 接受来自inject.js的消息数据,然后中转到background.js
|
||||
window.addEventListener("message", (event) => {
|
||||
let data: PluginEvent = event.data;
|
||||
|
19
cc-inspector/src/scripts/terminal.ts
Normal file
19
cc-inspector/src/scripts/terminal.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
export class Terminal {
|
||||
color = 'red';
|
||||
background = 'yellow';
|
||||
tag = 'terminal';
|
||||
constructor(tag: string, color: string = 'red', background: string = 'yellow') {
|
||||
this.color = color;
|
||||
this.background = background;
|
||||
this.tag = tag;
|
||||
}
|
||||
ok() {
|
||||
this.log(`ok`);
|
||||
}
|
||||
log(message: string) {
|
||||
console.log(`%c${this.tag}%c${message}`, `color:${this.color};background:${this.background};padding:0 4px`, "color:black;margin-left:5px")
|
||||
}
|
||||
connect(msg: string) {
|
||||
this.log(`[connect] ${msg}`);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user