mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 17:14:46 +00:00
better way to judge <a download> support
This commit is contained in:
parent
e8b5043df7
commit
ceabbf7fc2
@ -1110,12 +1110,12 @@ if (empty($act)) {
|
||||
});
|
||||
|
||||
function refresh_download_link(jquery_key, content, filename) {
|
||||
if (navigator.userAgent.indexOf('MSIE ') !== -1 || navigator.userAgent.indexOf('Trident') !== -1) {
|
||||
// IE11 support; they do not have <a download="">
|
||||
$(jquery_key).attr('href', '/system_certmanager.php?act=download_pem_file&content=' + encodeURIComponent(content) + '&filename=' + encodeURIComponent(filename));
|
||||
} else {
|
||||
if (document.createElement('a').download !== undefined) { // check <a download=""> support
|
||||
$(jquery_key).attr('href', URL.createObjectURL(new Blob([content])));
|
||||
$(jquery_key).attr('download', filename + '.pem');
|
||||
} else {
|
||||
// IE11 support; they do not have <a download="">
|
||||
$(jquery_key).attr('href', '/system_certmanager.php?act=download_pem_file&content=' + encodeURIComponent(content) + '&filename=' + encodeURIComponent(filename));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user