change pageAction icon based on slop detection

This commit is contained in:
Jack Case
2025-10-16 19:22:21 -04:00
parent f3108cf6c6
commit 13cdafd017
3 changed files with 21 additions and 0 deletions

BIN
icons/virus_red.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
icons/virus_yellow.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -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)
}