From 5c47b339676410e0343bd08a9f309e265bb23fa1 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 20 Aug 2019 14:16:18 -0400 Subject: [PATCH] process bitwardenFrameId on safari --- src/browser/browserApi.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/browser/browserApi.ts b/src/browser/browserApi.ts index 9250cdfe5a..d8f156d91b 100644 --- a/src/browser/browserApi.ts +++ b/src/browser/browserApi.ts @@ -208,7 +208,14 @@ export class BrowserApi { callback(msg, sender, response); }); } else if (BrowserApi.isSafariApi) { - SafariApp.addMessageListener(name, callback); + SafariApp.addMessageListener(name, (message: any, sender: any, response: any) => { + if (message.bitwardenFrameId != null) { + if (sender != null && typeof (sender) === 'object' && sender.frameId == null) { + sender.frameId = message.bitwardenFrameId; + } + } + callback(message, sender, response); + }); /* safari.application.addEventListener('message', async (msgEvent: any) => { callback(msgEvent.message, {