diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2022-03-18 00:12:37 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2022-03-18 00:12:37 +0300 |
commit | f97f1b4da99b6cb8e4d7d85d171793302f207de6 (patch) | |
tree | 5fe093a716e1f3a088746e0b166dabe226e47b4c | |
parent | update QR code on config updates (diff) | |
download | wireguard-config-f97f1b4da99b6cb8e4d7d85d171793302f207de6.tar.gz wireguard-config-f97f1b4da99b6cb8e4d7d85d171793302f207de6.zip |
fix downloaded file names on Android
-rw-r--r-- | assets/js/main.js | 4 |
1 files changed, 3 insertions, 1 deletions
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 = $('<a/>'); |