()
| 41 | private EE = new EventEmitter<string, any>(); |
| 42 | |
| 43 | constructor() { |
| 44 | chrome.runtime.onMessage.addListener((msg: TMessage) => { |
| 45 | const lastError = chrome.runtime.lastError; |
| 46 | const topic = msg.msgQueue; |
| 47 | if (typeof topic !== "string") return; |
| 48 | if (lastError) { |
| 49 | console.error("chrome.runtime.lastError in chrome.runtime.onMessage:", lastError); |
| 50 | // 消息API发生错误因此不继续执行 |
| 51 | return false; |
| 52 | } |
| 53 | this.handler(topic, msg.data); |
| 54 | }); |
| 55 | } |
| 56 | |
| 57 | handler(topic: string, { action, message }: { action: string; message: any }) { |
| 58 | LoggerCore.getInstance() |
nothing calls this directly
no test coverage detected