From 039f09e33fd7271458e9f7fbcbca53247dc5236c Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 15 Aug 2019 14:06:59 -0400 Subject: [PATCH] safariapp apis updates --- src/browser/browserApi.ts | 2 +- src/browser/safariApp.ts | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/browser/browserApi.ts b/src/browser/browserApi.ts index 9f15fe201c..bdf2e7ec39 100644 --- a/src/browser/browserApi.ts +++ b/src/browser/browserApi.ts @@ -156,7 +156,7 @@ export class BrowserApi { return chrome.runtime.getManifest().version; } else if (BrowserApi.isSafariApi) { // TODO - return 'TODO'; + return null; } else { return null; } diff --git a/src/browser/safariApp.ts b/src/browser/safariApp.ts index 43fe17e3e1..47de4fa383 100644 --- a/src/browser/safariApp.ts +++ b/src/browser/safariApp.ts @@ -3,8 +3,11 @@ import { BrowserApi } from './browserApi'; export class SafariApp { static init() { if (BrowserApi.isSafariApi) { - (window as any).bitwardenSafariAppMessageReceiver = (message: any) => + (window as any).bitwardenSafariAppMessageReceiver = (message: any) => { + // tslint:disable-next-line + console.log(message); SafariApp.receiveMessageFromApp(message == null ? null : JSON.parse(message)); + }; } } @@ -19,6 +22,7 @@ export class SafariApp { id: messageId, command: command, data: data, + responseData: null, })); SafariApp.requests.set(messageId, { resolve: resolve, date: now }); }); @@ -31,6 +35,6 @@ export class SafariApp { return; } const p = SafariApp.requests.get(message.id); - p.resolve(message.data); + p.resolve(message.responseData); } }