Skip to content

Commit

Permalink
wip: add image download link target
Browse files Browse the repository at this point in the history
  • Loading branch information
iamogbz committed Dec 19, 2024
1 parent d94c42d commit e26c264
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scripts/export-element/index.user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,11 @@ import { html2canvas } from "libraries/html2canvas";
.join("-")
.toLowerCase()
.replace(/[/\\?%*:|"<>]+/g, "_")}.png`;
const download = document.createElement("a");
download.href = dataURI;
download.download = filename;
download.click();
const imageLink = document.createElement("a");
imageLink.target = "_blank";
imageLink.href = dataURI;
imageLink.download = filename;
imageLink.click();
document.body.removeChild(placeholderDiv);
}

Expand Down

0 comments on commit e26c264

Please sign in to comment.