aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/assets
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-03-18 00:12:37 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2022-03-18 00:12:37 +0300
commitf97f1b4da99b6cb8e4d7d85d171793302f207de6 (patch)
tree5fe093a716e1f3a088746e0b166dabe226e47b4c /assets
parentupdate QR code on config updates (diff)
downloadwireguard-config-f97f1b4da99b6cb8e4d7d85d171793302f207de6.tar.gz
wireguard-config-f97f1b4da99b6cb8e4d7d85d171793302f207de6.zip
fix downloaded file names on Android
Diffstat (limited to '')
-rw-r--r--assets/js/main.js4
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/>');