1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Merge pull request #4162 from kazuhitoyokoi/master-fixdownload4ipad

Fix content type for downloading flows.json
This commit is contained in:
Nick O'Leary 2023-05-22 12:48:05 +01:00 committed by GitHub
commit 29db82625f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,13 +37,13 @@ RED.clipboard = (function() {
// IE11 workaround // IE11 workaround
// IE does not support data uri scheme for downloading data // IE does not support data uri scheme for downloading data
var blob = new Blob([data], { var blob = new Blob([data], {
type: "data:text/plain;charset=utf-8" type: "data:application/json;charset=utf-8"
}); });
navigator.msSaveBlob(blob, file); navigator.msSaveBlob(blob, file);
} }
else { else {
var element = document.createElement('a'); var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(data)); element.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(data));
element.setAttribute('download', file); element.setAttribute('download', file);
element.style.display = 'none'; element.style.display = 'none';
document.body.appendChild(element); document.body.appendChild(element);