Fix JS error when this.sender.tab
is undefined
This commit is contained in:
parent
c0fd71dda6
commit
a9021f375e
|
@ -43,13 +43,15 @@ 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+
|
if (this.sender.tab) {
|
||||||
// Chrome 49 doesn't report own extension pages in webNavigation apparently
|
// TODO: remove once our manifest's minimum_chrome_version is 50+
|
||||||
// so we do a force update which doesn't use the cache.
|
// Chrome 49 doesn't report own extension pages in webNavigation apparently
|
||||||
if (CHROME && CHROME < 2661 && this.sender.tab.url.startsWith(URLS.ownOrigin)) {
|
// so we do a force update which doesn't use the cache.
|
||||||
updateIconBadgeForce(this.sender.tab.id, count);
|
if (CHROME && CHROME < 2661 && this.sender.tab.url.startsWith(URLS.ownOrigin)) {
|
||||||
} else {
|
updateIconBadgeForce(this.sender.tab.id, count);
|
||||||
updateIconBadge(this.sender.tab.id, count);
|
} else {
|
||||||
|
updateIconBadge(this.sender.tab.id, count);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user