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

@ -17,6 +17,7 @@ div {
height: auto;
z-index: 1;
position: relative;
white-space: nowrap;
}
.action + .action {

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 15 KiB

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

View File

@ -56,8 +56,8 @@
"browser_action": {
"browser_style": true,
"default_icon": {
"19": "icons/icon.svg",
"38": "icons/icon.svg"
"19": "icons/browserAction-notPrinted.svg",
"38": "icons/browserAction-notPrinted.svg"
},
"default_title": "CanvasBlocker",
"default_popup": "browserAction/browserAction.html"