diff --git a/src/background/main.background.ts b/src/background/main.background.ts index d21237337a..6fb4ea6ab5 100644 --- a/src/background/main.background.ts +++ b/src/background/main.background.ts @@ -820,17 +820,13 @@ export default class MainBackground { }); } - private tabsQueryFirst(options: any): Promise { - return new Promise((resolve) => { - chrome.tabs.query(options, (tabs: any[]) => { - if (tabs.length > 0) { - resolve(tabs[0]); - return; - } + private async tabsQueryFirst(options: any): Promise { + const tabs = await this.tabsQuery(options); + if (tabs.length > 0) { + return tabs[0]; + } - resolve(null); - }); - }); + return null; } private actionSetIcon(theAction: any, suffix: string): Promise {