mirror of
https://github.com/bitwarden/web
synced 2025-12-11 13:53:17 +00:00
savefile imeplementation
This commit is contained in:
@@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user