mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix: remove trailing '.' in filename
firefox removes it but chrome sanitizes it to '_'
This commit is contained in:
@@ -899,10 +899,13 @@
|
||||
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
const filename = data.paste?.title
|
||||
? `${data.paste.title.slice(0, 100)}${extension ? `.${extension}` : ''}`
|
||||
: `paste_${data.paste?.id}${extension ? `.${extension}` : ''}`;
|
||||
|
||||
a.href = url;
|
||||
a.download = data.paste?.title
|
||||
? `${data.paste.title.slice(0, 100)}.${extension}`
|
||||
: `paste_${data.paste?.id}.${extension}`;
|
||||
a.download = filename;
|
||||
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
|
||||
Reference in New Issue
Block a user