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

implement platform utils additions

This commit is contained in:
Kyle Spearrin 2018-01-25 14:31:54 -05:00
parent d9fb4f2d67
commit f2f34c8e70
2 changed files with 12 additions and 1 deletions

View File

@ -161,7 +161,6 @@ angular
cryptoService.getOrgKey($scope.cipher.organizationId).then(function (key) {
return cryptoService.decryptFromBytes(req.response, key);
}).then(function (decBuf) {
var blob = new Blob([decBuf]);
BrowserApi.downloadFile($window, decBuf, null, attachment.fileName);
$timeout(function () {

View File

@ -140,6 +140,18 @@ export default class BrowserPlatformUtilsService implements PlatformUtilsService
return tabOpen;
}
launchUri(uri: string, options?: any): void {
BrowserApi.createNewTab(uri, options && options.extensionPage === true);
}
saveFile(win: Window, blobData: any, blobOptions: any, fileName: string): void {
BrowserApi.downloadFile(win, blobData, blobOptions, fileName);
}
alertError(title: string, message: string): void {
// TODO
}
private sidebarViewName(): string {
if ((window as any).chrome.sidebarAction && this.isFirefox()) {
return 'sidebar';