diff options
author | elioat <elioat@tilde.institute> | 2024-06-29 21:23:05 -0400 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2024-06-29 21:23:05 -0400 |
commit | 3900b10bd2eb73d9a3b2e52973b89546b4ec43ee (patch) | |
tree | 19433f767723e9b386f0de3e2b9d4776f334f429 /js/dither/dither.js | |
parent | 18062ebd2bdc5d090676e6f606c33299b665f6cb (diff) | |
download | tour-3900b10bd2eb73d9a3b2e52973b89546b4ec43ee.tar.gz |
*
Diffstat (limited to 'js/dither/dither.js')
-rw-r--r-- | js/dither/dither.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/js/dither/dither.js b/js/dither/dither.js index f7e549f..7bfdc13 100644 --- a/js/dither/dither.js +++ b/js/dither/dither.js @@ -24,6 +24,8 @@ document.getElementById('download').addEventListener('click', function() { const a = document.createElement('a'); // Create an anchor element a.href = dataUrl; // Set the href of the anchor to the data URL a.download = 'dithered-image.png'; // Set the download attribute to the desired file name + a.setAttribute('rel', 'noopener noreferrer'); + a.setAttribute('target', '_blank'); document.body.appendChild(a); // Append the anchor to the body a.click(); // Trigger a click on the anchor to start the download document.body.removeChild(a); // Remove the anchor from the body |