1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-07 09:31:31 +01:00

process bitwardenFrameId on safari

This commit is contained in:
Kyle Spearrin 2019-08-20 14:16:18 -04:00
parent 7d2c4cbd9a
commit 5c47b33967

View File

@ -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, {