mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-07 09:31:31 +01:00
safariapp apis updates
This commit is contained in:
parent
e5e04b8fa9
commit
039f09e33f
@ -156,7 +156,7 @@ export class BrowserApi {
|
||||
return chrome.runtime.getManifest().version;
|
||||
} else if (BrowserApi.isSafariApi) {
|
||||
// TODO
|
||||
return 'TODO';
|
||||
return null;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user