diff --git a/icons/virus_red.png b/icons/virus_red.png new file mode 100644 index 0000000..4fcd44a Binary files /dev/null and b/icons/virus_red.png differ diff --git a/icons/virus_yellow.png b/icons/virus_yellow.png new file mode 100644 index 0000000..9fcf9ed Binary files /dev/null and b/icons/virus_yellow.png differ diff --git a/scripts/report-slop.js b/scripts/report-slop.js index 0e7b3d9..eb086d0 100644 --- a/scripts/report-slop.js +++ b/scripts/report-slop.js @@ -120,7 +120,28 @@ async function on_button_clicked_handler(tab) { } async function update_page_action_icon(details) { + if(details.frameId != 0) { + return + } const is_slop = await check_slop(details.url) + if(is_slop.slop_path) { + browser.pageAction.setIcon({ + path: "icons/virus_red.png", + tabId: details.tabId + }) + } + else if(is_slop.slop_domain) { + browser.pageAction.setIcon({ + path: "icons/virus_yellow.png", + tabId: details.tabId + }) + } + else { + browser.pageAction.setIcon({ + path: "icons/virus-slash.png", + tabId: details.tabId + }) + } console.log(is_slop) }