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 url = URL.createObjectURL(blob);
|
||||||
const a = document.createElement('a');
|
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.href = url;
|
||||||
a.download = data.paste?.title
|
a.download = filename;
|
||||||
? `${data.paste.title.slice(0, 100)}.${extension}`
|
|
||||||
: `paste_${data.paste?.id}.${extension}`;
|
|
||||||
document.body.appendChild(a);
|
document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
document.body.removeChild(a);
|
document.body.removeChild(a);
|
||||||
|
|||||||
Reference in New Issue
Block a user