From f97f1b4da99b6cb8e4d7d85d171793302f207de6 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 18 Mar 2022 00:12:37 +0300 Subject: fix downloaded file names on Android --- assets/js/main.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assets/js/main.js b/assets/js/main.js index 2d205dd..0a33b42 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -373,7 +373,9 @@ function basename(path) { } function dload_btn_on_click(btn, path, pre) { - var blob = new Blob([pre.text()], {type: 'text/plain'}); + // The type must be application/octet-stream; if it's text/plain, the + // Android Chrome appends the .txt suffix to the downloaded file names. + var blob = new Blob([pre.text()], {type: 'application/octet-stream'}); var url = URL.createObjectURL(blob); var link = $(''); -- cgit v1.2.3