From bb6e469ae3f8cec1f825cee6406ed45c8c6defd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=E1=BA=A7n=20Trung=20T=C3=ADn?= Date: Sun, 15 May 2022 01:01:27 +0700 Subject: [PATCH] Update message-passing.js Fix this allows showing the Web3 tab in Chrome devtool in dev mode. The tab still won't show in production mode though --- src/lib/message-passing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/message-passing.js b/src/lib/message-passing.js index 4a74ca0..7c59c38 100644 --- a/src/lib/message-passing.js +++ b/src/lib/message-passing.js @@ -19,7 +19,7 @@ export async function broadcastMessage(payload) { } // detect if we are in a webpage - if (!chrome.runtime.id) { + if (!chrome.runtime || !chrome.runtime.id) { // console.log('> sending message from webpage', fullPayload, window.origin); // pass the message via the window to our injector script which will relay it window.postMessage(JSON.stringify(fullPayload), window.origin);