diff --git a/js/common.js b/js/common.js index 2987d7e..09f8798 100644 --- a/js/common.js +++ b/js/common.js @@ -154,6 +154,20 @@ BrowserAction.prototype.setBadgeDefaults = function (tabId) { return true; }; +/** + * Set the browser icon badge to its loading state. + * @alias BrowserAction.setBadgeLoading(tabId) + * @param {Number} tabId If given, only sets loading state for this tab. + * @return {Boolean} Returns true. + * @method + */ +BrowserAction.prototype.setBadgeLoading = function (tabId) { + chrome.browserAction.setBadgeText({'text': '', 'tabId': tabId}); + chrome.browserAction.setTitle({'title': 'Loading data...', 'tabId': tabId}); + chrome.browserAction.setPopup({popup: '', tabId: tabId}); + return true; +}; + /** * Set the browser icon badge for a page. * @alias BrowserAction.setBadgeFor(url, tabId)