mirror of https://github.com/gorhill/uBlock.git
always set browserAction title
This commit is contained in:
parent
e86290e988
commit
645c862886
|
@ -614,7 +614,8 @@ vAPI.tabs.injectScript = function(tabId, details, callback) {
|
||||||
// Firefox for Android does no support browser.browserAction.setIcon().
|
// Firefox for Android does no support browser.browserAction.setIcon().
|
||||||
|
|
||||||
vAPI.setIcon = (function() {
|
vAPI.setIcon = (function() {
|
||||||
var titleTemplate = chrome.runtime.getManifest().name + ' ({badge})';
|
var browserAction = chrome.browserAction,
|
||||||
|
titleTemplate = chrome.runtime.getManifest().name + ' ({badge})';
|
||||||
var iconPaths = [
|
var iconPaths = [
|
||||||
{
|
{
|
||||||
'19': 'img/browsericons/icon19-off.png',
|
'19': 'img/browsericons/icon19-off.png',
|
||||||
|
@ -630,8 +631,8 @@ vAPI.setIcon = (function() {
|
||||||
tabId = toChromiumTabId(tabId);
|
tabId = toChromiumTabId(tabId);
|
||||||
if ( tabId === 0 ) { return; }
|
if ( tabId === 0 ) { return; }
|
||||||
|
|
||||||
if ( chrome.browserAction.setIcon !== undefined ) {
|
if ( browserAction.setIcon !== undefined ) {
|
||||||
chrome.browserAction.setIcon(
|
browserAction.setIcon(
|
||||||
{
|
{
|
||||||
tabId: tabId,
|
tabId: tabId,
|
||||||
path: iconPaths[iconStatus === 'on' ? 1 : 0]
|
path: iconPaths[iconStatus === 'on' ? 1 : 0]
|
||||||
|
@ -650,8 +651,10 @@ vAPI.setIcon = (function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else if ( chrome.browserAction.setTitle !== undefined ) {
|
}
|
||||||
chrome.browserAction.setTitle({
|
|
||||||
|
if ( browserAction.setTitle !== undefined ) {
|
||||||
|
browserAction.setTitle({
|
||||||
tabId: tabId,
|
tabId: tabId,
|
||||||
title: titleTemplate.replace(
|
title: titleTemplate.replace(
|
||||||
'{badge}',
|
'{badge}',
|
||||||
|
|
|
@ -903,7 +903,7 @@ vAPI.tabs.registerListeners();
|
||||||
if ( vAPI.isBehindTheSceneTabId(tabId) ) {
|
if ( vAPI.isBehindTheSceneTabId(tabId) ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tabIdToTimer[tabId] = vAPI.setTimeout(updateBadge.bind(this, tabId), 666);
|
tabIdToTimer[tabId] = vAPI.setTimeout(updateBadge.bind(this, tabId), 701);
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue