Attempt to fix a problem with lots of errors being logged in the console
This commit is contained in:
parent
c22c8a9045
commit
d512e3cede
|
@ -3,7 +3,7 @@ import { getshorthost, makeThrottle } from './util';
|
||||||
import { RequestCluster } from './request-cluster';
|
import { RequestCluster } from './request-cluster';
|
||||||
import { SaferEmitter } from './safer-emitter';
|
import { SaferEmitter } from './safer-emitter';
|
||||||
|
|
||||||
function setDomainsNumber(counter: number, tabId: number) {
|
function setDomainsCount(counter: number, tabId: number) {
|
||||||
browser.browserAction.setBadgeText({ text: counter < 0 ? '0' : counter.toString(), tabId });
|
browser.browserAction.setBadgeText({ text: counter < 0 ? '0' : counter.toString(), tabId });
|
||||||
browser.browserAction.setTitle({
|
browser.browserAction.setTitle({
|
||||||
title: 'Rentgen',
|
title: 'Rentgen',
|
||||||
|
@ -35,11 +35,13 @@ export default class Memory extends SaferEmitter {
|
||||||
? browser.browserAction.setBadgeBackgroundColor({ color: '#ff726b' })
|
? browser.browserAction.setBadgeBackgroundColor({ color: '#ff726b' })
|
||||||
: browser.browserAction.setBadgeBackgroundColor({ color: '#ffb900' });
|
: browser.browserAction.setBadgeBackgroundColor({ color: '#ffb900' });
|
||||||
|
|
||||||
setDomainsNumber(
|
if (request.tabId >= 0) {
|
||||||
|
setDomainsCount(
|
||||||
Object.values(this.getClustersForOrigin(request.origin)).length,
|
Object.values(this.getClustersForOrigin(request.origin)).length,
|
||||||
request.tabId
|
request.tabId
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user