mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
prevent a new iframe being created for every download
This commit is contained in:
parent
669865f8db
commit
1c4818cf1d
@ -20,7 +20,7 @@ export async function downloadInIframe(container, iframeSrc, blob, filename) {
|
|||||||
iframe = document.createElement("iframe");
|
iframe = document.createElement("iframe");
|
||||||
iframe.setAttribute("sandbox", "allow-scripts allow-downloads allow-downloads-without-user-activation");
|
iframe.setAttribute("sandbox", "allow-scripts allow-downloads allow-downloads-without-user-activation");
|
||||||
iframe.setAttribute("src", iframeSrc);
|
iframe.setAttribute("src", iframeSrc);
|
||||||
iframe.className = "hidden";
|
iframe.className = "hidden downloadSandbox";
|
||||||
container.appendChild(iframe);
|
container.appendChild(iframe);
|
||||||
let detach;
|
let detach;
|
||||||
await new Promise((resolve, reject) => {
|
await new Promise((resolve, reject) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user