mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 10:13:31 +00:00
[PM-254] Set PDF Attachments in Web to download, add success toast (#10757)
* add success toast to pdf attachment download in web * update desktop attachments for toastService * removed trailing comma --------- Co-authored-by: gbubemismith <gsmithwalter@gmail.com> Co-authored-by: SmithThe4th <gsmith@bitwarden.com>
This commit is contained in:
@@ -12,14 +12,12 @@ export class WebFileDownloadService implements FileDownloadService {
|
||||
download(request: FileDownloadRequest): void {
|
||||
const builder = new FileDownloadBuilder(request);
|
||||
const a = window.document.createElement("a");
|
||||
if (builder.downloadMethod === "save") {
|
||||
a.download = request.fileName;
|
||||
} else if (!this.platformUtilsService.isSafari()) {
|
||||
if (!this.platformUtilsService.isSafari()) {
|
||||
a.rel = "noreferrer";
|
||||
a.target = "_blank";
|
||||
}
|
||||
a.href = URL.createObjectURL(builder.blob);
|
||||
a.style.position = "fixed";
|
||||
a.download = request.fileName;
|
||||
window.document.body.appendChild(a);
|
||||
a.click();
|
||||
window.document.body.removeChild(a);
|
||||
|
||||
Reference in New Issue
Block a user