fix: add download attribute to fix JAR files saving as ZIP in Chromium (#6065)

* fix: add download attribute to fix JAR files saving as ZIP in Chromium

- JAR files were downloading with a `.zip` extension in Chromium-based browsers (Chrome, Edge, Arc, Brave, Opera, Vivaldi)
- Root cause: JAR files are ZIP archives internally, so Chromium sniffs the `Content-Type` as `application/zip` and overrides the filename extension when no `download` attribute is present
- Fix: add `download="<filename>"` to all file download `<a>` tags so the browser uses the original filename from the API

* fix: add download attribute to remaining download links

Missed in initial pass: changelog page button, versions overflow
menu, settings/versions overflow menu. Also adds `download` prop
to Button and OverflowMenu to support dropdown link items.

Adds missing `getPrimaryFile` definition in changelog.vue.

---------

Co-authored-by: Mr_chank <180248271+chank-op@users.noreply.github.com>
Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
Mr_chank
2026-05-16 00:58:26 +10:00
committed by GitHub
parent e9eb98f97e
commit 02a7774722
7 changed files with 26 additions and 3 deletions

View File

@@ -57,6 +57,7 @@
<a
class="ml-auto"
:href="createDownloadUrl(version)"
:download="getPrimaryFile(version).filename"
:title="`Download ${version.name}`"
>
<DownloadIcon aria-hidden="true" />

View File

@@ -111,6 +111,7 @@
color: 'primary',
hoverFilled: true,
link: createDownloadUrl(version),
download: getPrimaryFile(version).filename,
action: () => {
emit('onDownload')
},

View File

@@ -140,6 +140,7 @@
<a
v-tooltip="primaryFile.filename + ' (' + formatBytes(primaryFile.size) + ')'"
:href="decoratedPrimaryFileUrl"
:download="primaryFile.filename"
@click="emit('onDownload')"
>
<DownloadIcon aria-hidden="true" />
@@ -307,6 +308,7 @@
:href="decorateDownloadUrl(file.url)"
class="raised-button"
:title="`Download ${file.filename}`"
:download="file.filename"
tabindex="0"
>
<DownloadIcon aria-hidden="true" />

View File

@@ -47,6 +47,7 @@
<a
v-tooltip="`Download`"
:href="createDownloadUrl(version)"
:download="getPrimaryFile(version).filename"
class="hover:!bg-button-bg [&>svg]:!text-green"
aria-label="Download"
@click="emit('onDownload')"
@@ -101,6 +102,7 @@
color: 'primary',
hoverFilled: true,
link: createDownloadUrl(version),
download: getPrimaryFile(version).filename,
action: () => {
emit('onDownload')
},