mirror of
https://github.com/wassname/Mostly-Harmless.git
synced 2026-07-21 12:20:05 +08:00
Added loading state
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user