diff --git a/html/background.html b/html/background.html
index 07b789a..a99e869 100644
--- a/html/background.html
+++ b/html/background.html
@@ -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();
diff --git a/js/common.js b/js/common.js
index e3b2928..8d711b1 100644
--- a/js/common.js
+++ b/js/common.js
@@ -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)