Fix chat exporting when someone has used unicode

Only affects clients still using 512
This commit is contained in:
Arokha Sieyes
2020-03-14 23:51:08 -04:00
parent 921079908d
commit f9b732f94a

View File

@@ -641,9 +641,6 @@ function start_vue() {
textToSave += "<br>\n"; textToSave += "<br>\n";
}); });
textToSave += "</body></html>"; textToSave += "</body></html>";
var hiddenElement = document.createElement('a');
hiddenElement.href = 'data:attachment/text,' + encodeURI(textToSave);
hiddenElement.target = '_blank';
var fileprefix = "log"; var fileprefix = "log";
var extension =".html"; var extension =".html";
@@ -671,14 +668,17 @@ function start_vue() {
var filename = fileprefix+datesegment+extension; var filename = fileprefix+datesegment+extension;
//Unlikely to work unfortunately, not supported in any version of IE, only Edge //Unlikely to work unfortunately, not supported in any version of IE, only Edge
var hiddenElement = document.createElement('a');
if (hiddenElement.download !== undefined) { if (hiddenElement.download !== undefined) {
hiddenElement.download = filename; hiddenElement.href = 'data:attachment/text,' + encodeURI(textToSave); //Has a problem in byond 512 due to weird unicode handling
hiddenElement.click(); hiddenElement.target = '_blank';
//Probably what will end up getting used hiddenElement.download = filename;
} else { hiddenElement.click();
let blob = new Blob([textToSave], {type: 'text/html;charset=utf8;'}); //Probably what will end up getting used
saved = window.navigator.msSaveOrOpenBlob(blob, filename); } else {
} var blob = new Blob([textToSave], {type: 'text/html;charset=utf8;'});
saved = window.navigator.msSaveOrOpenBlob(blob, filename);
}
}, },
do_latency_test: function() { do_latency_test: function() {
send_latency_check(); send_latency_check();