diff --git a/services/static-webserver/client/source/class/osparc/utils/Utils.js b/services/static-webserver/client/source/class/osparc/utils/Utils.js index d4b8aa9de481..8124b6818e19 100644 --- a/services/static-webserver/client/source/class/osparc/utils/Utils.js +++ b/services/static-webserver/client/source/class/osparc/utils/Utils.js @@ -804,11 +804,10 @@ qx.Class.define("osparc.utils.Utils", { loadedCb(); } const blob = new Blob([xhr.response]); - const urlBlob = window.URL.createObjectURL(blob); if (!fileName) { fileName = this.self().filenameFromContentDisposition(xhr); } - this.self().downloadContent(urlBlob, fileName); + this.self().downloadBlobContent(blob, fileName); resolve(); } else { reject(xhr); @@ -820,9 +819,9 @@ qx.Class.define("osparc.utils.Utils", { }); }, - downloadContent: function(content, filename = "file") { + downloadBlobContent: function(blob, filename = "file") { let downloadAnchorNode = document.createElement("a"); - downloadAnchorNode.setAttribute("href", content); + downloadAnchorNode.setAttribute("href", window.URL.createObjectURL(blob)); downloadAnchorNode.setAttribute("download", filename); downloadAnchorNode.click(); downloadAnchorNode.remove(); diff --git a/services/static-webserver/client/source/class/osparc/widget/logger/LoggerView.js b/services/static-webserver/client/source/class/osparc/widget/logger/LoggerView.js index 3ad1b437301c..e77ff8c6840b 100644 --- a/services/static-webserver/client/source/class/osparc/widget/logger/LoggerView.js +++ b/services/static-webserver/client/source/class/osparc/widget/logger/LoggerView.js @@ -317,9 +317,10 @@ qx.Class.define("osparc.widget.logger.LoggerView", { }, __getLogsString: function() { + const newLine = "\n"; let logs = ""; this.__loggerModel.getFilteredRows().forEach(rowData => { - logs += this.self().printRow(rowData) + "\n"; + logs += this.self().printRow(rowData) + newLine; }); return logs; }, @@ -338,7 +339,8 @@ qx.Class.define("osparc.widget.logger.LoggerView", { downloadLogs: function() { const logs = this.__getLogsString(); - osparc.utils.Utils.downloadContent("data:text/plain;charset=utf-8," + logs, "logs.log"); + const blob = new Blob([logs], {type: "text/plain"}); + osparc.utils.Utils.downloadBlobContent(blob, "logs.log"); }, debug: function(nodeId, msg = "") {