diff --git a/src/background/notification.background.ts b/src/background/notification.background.ts index c58f242690..580248a049 100644 --- a/src/background/notification.background.ts +++ b/src/background/notification.background.ts @@ -39,14 +39,14 @@ export default class NotificationBackground { return; } - BrowserApi.messageListener('notification.background', async (msg: any, sender: any, sendResponse: any) => { - await this.processMessage(msg, sender, sendResponse); + BrowserApi.messageListener('notification.background', async (msg: any, sender: chrome.runtime.MessageSender) => { + await this.processMessage(msg, sender); }); this.cleanupNotificationQueue(); } - async processMessage(msg: any, sender: any, sendResponse: any) { + async processMessage(msg: any, sender: chrome.runtime.MessageSender) { switch (msg.command) { case 'bgGetDataForTab': await this.getDataForTab(sender.tab, msg.responseCommand); diff --git a/src/background/runtime.background.ts b/src/background/runtime.background.ts index 4086a95740..e57073e1d3 100644 --- a/src/background/runtime.background.ts +++ b/src/background/runtime.background.ts @@ -36,7 +36,7 @@ export default class RuntimeBackground { } await this.checkOnInstalled(); - BrowserApi.messageListener('runtime.background', async (msg: any, sender: any, sendResponse: any) => { + BrowserApi.messageListener('runtime.background', async (msg: any, sender: chrome.runtime.MessageSender, sendResponse: any) => { await this.processMessage(msg, sender, sendResponse); }); } diff --git a/src/browser/browserApi.ts b/src/browser/browserApi.ts index 7ccc549e37..5efb4bc821 100644 --- a/src/browser/browserApi.ts +++ b/src/browser/browserApi.ts @@ -91,8 +91,8 @@ export class BrowserApi { chrome.tabs.create({ url: url, active: active }); } - static messageListener(name: string, callback: (message: any, sender: any, response: any) => void) { - chrome.runtime.onMessage.addListener((msg: any, sender: any, response: any) => { + static messageListener(name: string, callback: (message: any, sender: chrome.runtime.MessageSender, response: any) => void) { + chrome.runtime.onMessage.addListener((msg: any, sender: chrome.runtime.MessageSender, response: any) => { callback(msg, sender, response); }); }