From d90279a596c9261713d35bfe6e16c775433fc392 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Fri, 16 Aug 2019 10:54:19 -0400 Subject: [PATCH] tabsQuery fix --- src/browser/browserApi.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/browser/browserApi.ts b/src/browser/browserApi.ts index bd545ef725..3d459cfa6e 100644 --- a/src/browser/browserApi.ts +++ b/src/browser/browserApi.ts @@ -32,7 +32,7 @@ export class BrowserApi { }); } - static tabsQuery(options: any): Promise { + static async tabsQuery(options: any): Promise { if (BrowserApi.isChromeApi) { return new Promise((resolve) => { chrome.tabs.query(options, (tabs: any[]) => { @@ -40,7 +40,8 @@ export class BrowserApi { }); }); } else if (BrowserApi.isSafariApi) { - let wins: any[] = []; + const tabs = await SafariApp.sendMessageToApp('tabs_query', JSON.stringify(options)); + return tabs; // TODO /* if (options.currentWindow) { @@ -68,7 +69,6 @@ export class BrowserApi { return Promise.resolve(returnedTabs); */ - return Promise.resolve([]); } } @@ -93,7 +93,7 @@ export class BrowserApi { return BrowserApi.tabSendMessage(tab, obj); } - static async tabSendMessage(tab: any, obj: any, options: any = null): Promise { + static tabSendMessage(tab: any, obj: any, options: any = null): Promise { if (!tab || !tab.id) { return; } @@ -108,8 +108,6 @@ export class BrowserApi { }); }); } else if (BrowserApi.isSafariApi) { - const tabs = await SafariApp.sendMessageToApp('tabs_query', JSON.stringify(options)); - return tabs; // TODO /* let t = tab.safariTab; @@ -138,6 +136,8 @@ export class BrowserApi { t.page.dispatchMessage('bitwarden', obj); } */ + + return Promise.resolve(); } }