Skip to content

Commit

Permalink
Rename icon update function.
Browse files Browse the repository at this point in the history
  • Loading branch information
ghostwords committed Aug 21, 2019
1 parent fcc008c commit 74d2ec9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function Badger() {
chrome.tabs.query({}, function (tabs) {
for (let i = 0; i < tabs.length; i++) {
let tab = tabs[i];
self.refreshIconAndContextMenu(tab.id, tab.url);
self.updateIcon(tab.id, tab.url);
}
});

Expand Down Expand Up @@ -899,7 +899,7 @@ Badger.prototype = {
* @param {Integer} tab_id The tab ID to set the badger icon for
* @param {String} tab_url The tab URL to set the badger icon for
*/
refreshIconAndContextMenu: function (tab_id, tab_url) {
updateIcon: function (tab_id, tab_url) {
if (!tab_id || !tab_url || !FirefoxAndroid.hasPopupSupport) {
return;
}
Expand Down Expand Up @@ -952,15 +952,15 @@ Badger.prototype = {
function startBackgroundListeners() {
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
if (changeInfo.status == "loading" && tab.url) {
badger.refreshIconAndContextMenu(tab.id, tab.url);
badger.updateIcon(tab.id, tab.url);
badger.updateBadge(tabId);
}
});

// Update icon if a tab is replaced or loaded from cache
chrome.tabs.onReplaced.addListener(function(addedTabId/*, removedTabId*/) {
chrome.tabs.get(addedTabId, function(tab) {
badger.refreshIconAndContextMenu(tab.id, tab.url);
badger.updateIcon(tab.id, tab.url);
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/js/webrequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -724,12 +724,12 @@ function dispatcher(request, sender, sendResponse) {

} else if (request.type == "activateOnSite") {
badger.enablePrivacyBadgerForOrigin(request.tabHost);
badger.refreshIconAndContextMenu(request.tabId, request.tabUrl);
badger.updateIcon(request.tabId, request.tabUrl);
sendResponse();

} else if (request.type == "deactivateOnSite") {
badger.disablePrivacyBadgerForOrigin(request.tabHost);
badger.refreshIconAndContextMenu(request.tabId, request.tabUrl);
badger.updateIcon(request.tabId, request.tabUrl);
sendResponse();

} else if (request.type == "revertDomainControl") {
Expand Down

0 comments on commit 74d2ec9

Please sign in to comment.