From 2ba4014138e60c55a2d202ce004a69acaf3166bd Mon Sep 17 00:00:00 2001 From: sienori Date: Fri, 3 May 2019 05:24:45 +0900 Subject: [PATCH] =?UTF-8?q?Speed=20=E2=80=8B=E2=80=8Bup=20the=20display=20?= =?UTF-8?q?of=20the=20popup=20toggle=20button?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/popup/components/PopupPage.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/popup/components/PopupPage.js b/src/popup/components/PopupPage.js index 5237751..ffaf757 100644 --- a/src/popup/components/PopupPage.js +++ b/src/popup/components/PopupPage.js @@ -12,14 +12,14 @@ import "../styles/PopupPage.scss"; const getTabInfo = async () => { try { const tab = (await browser.tabs.query({ currentWindow: true, active: true }))[0]; - const tabUrl = await browser.tabs.sendMessage(tab.id, { message: "getTabUrl" }); - const selectedText = await browser.tabs.sendMessage(tab.id, { message: "getSelectedText" }); - const isEnabledOnPage = await browser.tabs.sendMessage(tab.id, { message: "getEnabled" }); + const tabUrl = browser.tabs.sendMessage(tab.id, { message: "getTabUrl" }); + const selectedText = browser.tabs.sendMessage(tab.id, { message: "getSelectedText" }); + const isEnabledOnPage = browser.tabs.sendMessage(tab.id, { message: "getEnabled" }); return { isConnected: true, - url: tabUrl, - selectedText: selectedText, - isEnabledOnPage: isEnabledOnPage + url: await tabUrl, + selectedText: await selectedText, + isEnabledOnPage: await isEnabledOnPage }; } catch (e) { return { isConnected: false, url: "", selectedText: "", isEnabledOnPage: false };