Added types: Use chrome.tabs instead of any
This commit is contained in:
parent
9c10961b9f
commit
06e47dea17
|
@ -1,24 +1,21 @@
|
||||||
import MainBackground from './main.background';
|
import MainBackground from './main.background';
|
||||||
|
|
||||||
export default class TabsBackground {
|
export default class TabsBackground {
|
||||||
private tabs: any;
|
|
||||||
|
|
||||||
constructor(private main: MainBackground) {
|
constructor(private main: MainBackground) {
|
||||||
this.tabs = chrome.tabs;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
if (!this.tabs) {
|
if (!chrome.tabs) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.tabs.onActivated.addListener(async (activeInfo: any) => {
|
chrome.tabs.onActivated.addListener(async (activeInfo: chrome.tabs.TabActiveInfo) => {
|
||||||
await this.main.refreshBadgeAndMenu();
|
await this.main.refreshBadgeAndMenu();
|
||||||
this.main.messagingService.send('tabActivated');
|
this.main.messagingService.send('tabActivated');
|
||||||
this.main.messagingService.send('tabChanged');
|
this.main.messagingService.send('tabChanged');
|
||||||
});
|
});
|
||||||
|
|
||||||
this.tabs.onReplaced.addListener(async (addedTabId: any, removedTabId: any) => {
|
chrome.tabs.onReplaced.addListener(async (addedTabId: number, removedTabId: number) => {
|
||||||
if (this.main.onReplacedRan) {
|
if (this.main.onReplacedRan) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +26,7 @@ export default class TabsBackground {
|
||||||
this.main.messagingService.send('tabChanged');
|
this.main.messagingService.send('tabChanged');
|
||||||
});
|
});
|
||||||
|
|
||||||
this.tabs.onUpdated.addListener(async (tabId: any, changeInfo: any, tab: any) => {
|
chrome.tabs.onUpdated.addListener(async (tabId: number, changeInfo: chrome.tabs.TabChangeInfo, tab: chrome.tabs.Tab) => {
|
||||||
if (this.main.onUpdatedRan) {
|
if (this.main.onUpdatedRan) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue