Fix: don't cache tab icon in old chrome
This commit is contained in:
parent
39a10079c4
commit
1dc2887f59
|
@ -38,6 +38,12 @@ window.API_METHODS = Object.assign(window.API_METHODS || {}, {
|
||||||
openEditor,
|
openEditor,
|
||||||
|
|
||||||
updateIconBadge(count) {
|
updateIconBadge(count) {
|
||||||
|
// TODO: remove once our manifest's minimum_chrome_version is 50+
|
||||||
|
// Chrome 49 doesn't report own extension pages in webNavigation apparently
|
||||||
|
// so we do a force update which doesn't use the cache.
|
||||||
|
if (CHROME && CHROME < 2661 && this.sender.tab.url.startsWith(URLS.ownOrigin)) {
|
||||||
|
return updateIconBadgeForce(this.sender.tab.id, count);
|
||||||
|
}
|
||||||
return updateIconBadge(this.sender.tab.id, count);
|
return updateIconBadge(this.sender.tab.id, count);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -344,6 +350,11 @@ function updateIconBadge(tabId, count) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function updateIconBadgeForce(tabId, count) {
|
||||||
|
refreshIconBadgeText(tabId, {count});
|
||||||
|
refreshIcon(tabId, {count});
|
||||||
|
}
|
||||||
|
|
||||||
function refreshIconBadgeText(tabId, icon) {
|
function refreshIconBadgeText(tabId, icon) {
|
||||||
iconUtil.setBadgeText({
|
iconUtil.setBadgeText({
|
||||||
text: prefs.get('show-badge') && icon.count ? String(icon.count) : '',
|
text: prefs.get('show-badge') && icon.count ? String(icon.count) : '',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user