From 700e03e0a9d32789efb061a45c6d534b85bbcb56 Mon Sep 17 00:00:00 2001 From: xuyanfeng Date: Sat, 8 May 2021 18:46:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E5=8D=B0=E5=B1=9E=E6=80=A7=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/src/content.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/src/content.ts b/source/src/content.ts index 1a188f4..a6f750f 100644 --- a/source/src/content.ts +++ b/source/src/content.ts @@ -10,7 +10,8 @@ let conn = chrome.runtime.connect({name: Page.Content}) conn.onMessage.addListener((data: PluginEvent, sender) => { // 将background.js的消息返回到injection.js if (PluginEvent.check(data, Page.Background, Page.Content)) { - console.log(`%c[Connect-Message] ${JSON.stringify(data)}`, "color:green;") + // console.log(`%c[Connect-Message] ${JSON.stringify(data)}`, "color:green;") + console.log('[Connect-Message]: ', data); PluginEvent.reset(data, Page.Content, Page.Inject) window.postMessage(data, "*"); } @@ -20,7 +21,8 @@ conn.onMessage.addListener((data: PluginEvent, sender) => { window.addEventListener('message', function (event) { let data: PluginEvent = event.data; if (PluginEvent.check(data, Page.Inject, Page.Content)) { - console.log(`%c[Window-Message] ${JSON.stringify(data)}`, "color:green;"); + // console.log(`%c[Window-Message] ${JSON.stringify(data)}`, "color:green;"); + console.log('[Window-Message]: ', data); PluginEvent.reset(data, Page.Content, Page.Background) chrome.runtime.sendMessage(data); }