mirror of
https://github.com/bitwarden/browser.git
synced 2025-01-04 18:37:45 +01:00
savefile imeplementation
This commit is contained in:
parent
3de3c7a189
commit
b34e511ddc
@ -74,7 +74,18 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
saveFile(win: Window, blobData: any, blobOptions: any, fileName: string): void {
|
saveFile(win: Window, blobData: any, blobOptions: any, fileName: string): void {
|
||||||
//
|
const blob = new Blob([blobData], blobOptions);
|
||||||
|
if (navigator.msSaveOrOpenBlob) {
|
||||||
|
navigator.msSaveBlob(blob, fileName);
|
||||||
|
} else {
|
||||||
|
const a = win.document.createElement('a');
|
||||||
|
a.href = win.URL.createObjectURL(blob);
|
||||||
|
a.download = fileName;
|
||||||
|
a.style.position = 'fixed';
|
||||||
|
win.document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
win.document.body.removeChild(a);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getApplicationVersion(): string {
|
getApplicationVersion(): string {
|
||||||
|
@ -24,5 +24,4 @@ export class WebStorageService implements StorageService {
|
|||||||
window.sessionStorage.removeItem(key);
|
window.sessionStorage.removeItem(key);
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user