From be4eab65f66fb98025f53633dabbcad45428eecd Mon Sep 17 00:00:00 2001 From: Kazuhito Yokoi Date: Sat, 6 May 2023 19:40:52 +0900 Subject: [PATCH 1/2] Fix content type for downloading flows.json --- .../@node-red/editor-client/src/js/ui/clipboard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js b/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js index f547203d4..b185a90c1 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js @@ -37,13 +37,13 @@ RED.clipboard = (function() { // IE11 workaround // IE does not support data uri scheme for downloading data var blob = new Blob([data], { - type: "data:text/plain;charset=utf-8" + type: "data:json/application;charset=utf-8" }); navigator.msSaveBlob(blob, file); } else { var element = document.createElement('a'); - element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(data)); + element.setAttribute('href', 'data:json/application;charset=utf-8,' + encodeURIComponent(data)); element.setAttribute('download', file); element.style.display = 'none'; document.body.appendChild(element); From e8ddee24a9944e57d186f02b081295c56a45b67c Mon Sep 17 00:00:00 2001 From: Kazuhito Yokoi Date: Sat, 6 May 2023 21:10:49 +0900 Subject: [PATCH 2/2] Use correct content type for downloading flows.json --- .../@node-red/editor-client/src/js/ui/clipboard.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js b/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js index b185a90c1..af82f1b14 100644 --- a/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js +++ b/packages/node_modules/@node-red/editor-client/src/js/ui/clipboard.js @@ -37,13 +37,13 @@ RED.clipboard = (function() { // IE11 workaround // IE does not support data uri scheme for downloading data var blob = new Blob([data], { - type: "data:json/application;charset=utf-8" + type: "data:application/json;charset=utf-8" }); navigator.msSaveBlob(blob, file); } else { var element = document.createElement('a'); - element.setAttribute('href', 'data:json/application;charset=utf-8,' + encodeURIComponent(data)); + element.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(data)); element.setAttribute('download', file); element.style.display = 'none'; document.body.appendChild(element);