1
0
Fork 0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2025-07-04 20:46:39 +02:00

Change browser action icon depending on fake status.

As mentioned in #217
This commit is contained in:
kkapsner 2018-07-31 13:36:34 +02:00
parent 4a6c5192f8
commit 05a3429dbe
5 changed files with 273 additions and 2 deletions

View file

@ -67,11 +67,25 @@
!lists.get("ignore").match(url)
){
browser.pageAction.show(port.sender.tab.id);
browser.browserAction.setIcon({
tabId: port.sender.tab.id,
path: {
"19": "icons/browserAction-printed.svg",
"38": "icons/browserAction-printed.svg"
}
});
}
}
if (data.hasOwnProperty("canvasBlocker-clear-page-action")){
notice("Hide page action for tab", port.sender.tab.id);
browser.pageAction.hide(port.sender.tab.id);
browser.browserAction.setIcon({
tabId: port.sender.tab.id,
path: {
"19": "icons/browserAction-notPrinted.svg",
"38": "icons/browserAction-notPrinted.svg"
}
});
}
verbose("got data", data, "from port", port);
});