mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-07 09:31:31 +01:00
Merge branch 'master' of github.com:bitwarden/browser
This commit is contained in:
commit
15d62e2d97
@ -39,10 +39,17 @@ export class SafariApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static receiveMessageFromApp(message: any) {
|
private static receiveMessageFromApp(message: any) {
|
||||||
if (message == null || message.id == null || !(window as any).bitwardenSafariAppRequests.has(message.id)) {
|
if (message == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const p = (window as any).bitwardenSafariAppRequests.get(message.id);
|
if (message.id == null && message.command === 'cs_message') {
|
||||||
p.resolve(message.responseData);
|
try {
|
||||||
|
const msg = JSON.parse(message.data);
|
||||||
|
SafariApp.sendMessageToListeners(msg, 'cs_message', null);
|
||||||
|
} catch { }
|
||||||
|
} else if (message.id != null && (window as any).bitwardenSafariAppRequests.has(message.id)) {
|
||||||
|
const p = (window as any).bitwardenSafariAppRequests.get(message.id);
|
||||||
|
p.resolve(message.responseData);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user