diff options
author | hackademix <giorgio@maone.net> | 2018-07-31 22:41:47 +0200 |
---|---|---|
committer | hackademix <giorgio@maone.net> | 2018-07-31 22:41:47 +0200 |
commit | a970659c31ae801079075608777c73f7741224bc (patch) | |
tree | 22ee3e75fdf63d9f6e84488f4b1f8d15dc88fee3 | |
parent | a11a57a8f8371a0f521eea819d08588d9ce12bdc (diff) |
Fixed sub-frames resetting badge to green.
-rw-r--r-- | main_background.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/main_background.js b/main_background.js index 2b2a975..85cadaa 100644 --- a/main_background.js +++ b/main_background.js @@ -1064,15 +1064,17 @@ function edit_html(html,url,tabid,wl){ async function handle_html(response, whitelisted) { let {text, request} = response; let {url, tabId, type} = request; - if (type === "main_frame") delete unused_data[tabId]; - browser.browserAction.setBadgeText({ - text: "✓", - tabId - }); - browser.browserAction.setBadgeBackgroundColor({ - color: "green", - tabId - }); + if (type === "main_frame") { + delete unused_data[tabId]; + browser.browserAction.setBadgeText({ + text: "✓", + tabId + }); + browser.browserAction.setBadgeBackgroundColor({ + color: "green", + tabId + }); + } return await edit_html(text, url, tabId, whitelisted); } |