Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: background.js

Issue 5426447338438656: Fix icon animation (Closed)
Patch Set: Created Feb. 27, 2014, 7:12 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | iconAnimation.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: background.js
===================================================================
--- a/background.js
+++ b/background.js
@@ -103,8 +103,7 @@
// Adds or removes browser action icon according to options.
function refreshIconAndContextMenu(tab)
{
- if(!/^https?:/.test(tab.url))
- return;
+ var whitelisted = isWhitelisted(tab.url);
var iconFilename;
if (require("info").platform == "safari")
@@ -113,16 +112,13 @@
// aren't per tab in Safari.
iconFilename = "icons/abp-16.png"
else
- {
- var excluded = isWhitelisted(tab.url);
- iconFilename = excluded ? "icons/abp-19-whitelisted.png" : "icons/abp-19.png";
- }
+ iconFilename = whitelisted ? "icons/abp-19-whitelisted.png" : "icons/abp-19.png";
tab.browserAction.setIcon(iconFilename);
iconAnimation.registerTab(tab, iconFilename);
// Set context menu status according to whether current tab has whitelisted domain
- if (excluded)
+ if (whitelisted || !/^https?:/.test(tab.url))
ext.contextMenus.hideMenuItems();
else
ext.contextMenus.showMenuItems();
« no previous file with comments | « no previous file | iconAnimation.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld