aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--background_page.html13
-rw-r--r--icons/icon48.pngbin4222 -> 4254 bytes
-rw-r--r--icons/icon48disabled.pngbin0 -> 3648 bytes
-rw-r--r--manifest.json5
4 files changed, 17 insertions, 1 deletions
diff --git a/background_page.html b/background_page.html
index aed9617b..881024c3 100644
--- a/background_page.html
+++ b/background_page.html
@@ -332,6 +332,14 @@
delete framesForTab[tab.id];
}
+ function updateIconState(tabId) {
+ if (openTabs[tabId]) {
+ var isEnabled = isEnabledForUrl({url: openTabs[tabId].url}).isEnabledForUrl;
+ var iconPath = isEnabled ? "icons/icon48.png" : "icons/icon48disabled.png";
+ chrome.browserAction.setIcon({path: iconPath});
+ }
+ }
+
function handleUpdateScrollPosition(request, sender) {
updateScrollPosition(sender.tab, request.scrollX, request.scrollY);
}
@@ -345,6 +353,7 @@
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
if (changeInfo.status != "loading") { return; } // only do this once per URL change
updateOpenTabs(tab);
+ updateIconState(tabId);
});
chrome.tabs.onAttached.addListener(function(tabId, attachedInfo) {
@@ -383,6 +392,10 @@
delete framesForTab[tabId];
});
+ chrome.tabs.onActiveChanged.addListener(function(tabId, selectInfo) {
+ updateIconState(tabId);
+ });
+
chrome.windows.onRemoved.addListener(function(windowId) {
delete tabQueue[windowId];
});
diff --git a/icons/icon48.png b/icons/icon48.png
index 6a3202f0..9eb94d4f 100644
--- a/icons/icon48.png
+++ b/icons/icon48.png
Binary files differ
diff --git a/icons/icon48disabled.png b/icons/icon48disabled.png
new file mode 100644
index 00000000..fa6279d3
--- /dev/null
+++ b/icons/icon48disabled.png
Binary files differ
diff --git a/manifest.json b/manifest.json
index 085caaed..31b9e976 100644
--- a/manifest.json
+++ b/manifest.json
@@ -29,5 +29,8 @@
"run_at": "document_start",
"all_frames": true
}
- ]
+ ],
+ "browser_action": {
+ "default_icon": "icons/icon48disabled.png"
+ }
}