mirror of
https://github.com/lux-tel/session-desktop.git
synced 2026-10-30 20:33:24 +00:00
15 lines
285 B
TypeScript
15 lines
285 B
TypeScript
export const saveURLAsFile = ({
|
|
filename,
|
|
url,
|
|
document,
|
|
}: {
|
|
filename: string;
|
|
url: string;
|
|
document: Document;
|
|
}): void => {
|
|
const anchorElement = document.createElement('a');
|
|
anchorElement.href = url;
|
|
anchorElement.download = filename;
|
|
anchorElement.click();
|
|
};
|