mirror of
https://github.com/wassname/Mostly-Harmless.git
synced 2026-07-13 01:00:14 +08:00
moved cache clearing to its own method for future development
This commit is contained in:
@@ -12,8 +12,7 @@
|
||||
background = new Background();
|
||||
|
||||
function initBackground() {
|
||||
cache.removeAll();
|
||||
button.setBadgeDefaults();
|
||||
background.clearCache();
|
||||
chrome.tabs.onUpdated.addListener(background.prepareBrowserAction);
|
||||
background.watchMail();
|
||||
reddit.getReddits();
|
||||
|
||||
@@ -934,6 +934,17 @@ function Background() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear cached data and reset cleared browser buttons
|
||||
* @alias Background.clearCache(tabId, info, tab)
|
||||
* @return {Boolean} Returns true.
|
||||
* @method
|
||||
*/
|
||||
Background.prototype.clearCache = function () {
|
||||
cache.removeAll();
|
||||
button.setBadgeDefaults();
|
||||
};
|
||||
|
||||
/**
|
||||
* Prepare the browser action (badge, popup, etc.) for a given tab.
|
||||
* @alias Background.prepareBrowserAction(tabId, info, tab)
|
||||
|
||||
Reference in New Issue
Block a user