Merge pull request #453 from lakca/master

fix download judgement.
This commit is contained in:
Tw93
2023-06-04 09:32:28 +08:00
committed by GitHub

View File

@@ -127,16 +127,16 @@ document.addEventListener('DOMContentLoaded', () => {
return; return;
} }
let filename = anchorElement.download ? anchorElement.download : getFilenameFromUrl(absoluteUrl)
// Process download links for Rust to handle. // Process download links for Rust to handle.
if ( if ((anchorElement.download /* download attribute */ || e.metaKey /* Click anchor with meta key pressed could download any kind of resource. */)
/\.[a-zA-Z0-9]+$/i.test(removeUrlParameters(absoluteUrl)) && && !externalDownLoadLink()
!externalDownLoadLink()
) { ) {
e.preventDefault(); e.preventDefault();
invoke('download_file', { invoke('download_file', {
params: { params: {
url: absoluteUrl, url: absoluteUrl,
filename: getFilenameFromUrl(absoluteUrl), filename,
}, },
}); });
} }