From 0d05ee0f92ec8821e13e2fdbe8789cdeecf29fe3 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Thu, 23 Dec 2021 19:30:54 +0100 Subject: [PATCH] Trigger call to extract lightning data only from http sites Not on any other tabs like for example internal settings pages --- src/app/screens/Home/index.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/screens/Home/index.jsx b/src/app/screens/Home/index.jsx index 60d4cd44be..c70d0649cb 100644 --- a/src/app/screens/Home/index.jsx +++ b/src/app/screens/Home/index.jsx @@ -59,7 +59,9 @@ function Home() { // Enhancement data is loaded asynchronously (for example because we need to fetch additional data). browser.tabs.query({ active: true, currentWindow: true }).then((tabs) => { - browser.tabs.sendMessage(tabs[0].id, { type: "extractLightningData" }); + if (tabs.length > 0 && tabs[0].url?.startsWith("http")) { + browser.tabs.sendMessage(tabs[0].id, { type: "extractLightningData" }); + } }); browser.runtime.onMessage.addListener(handleLightningDataMessage);