From 75568450795928c11ebc5c62fd78b28effcbd32b Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Fri, 7 Dec 2018 10:17:19 +0100 Subject: [PATCH] Fix download binary button for firefox --- esphomeyaml/dashboard/static/esphomeyaml.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/esphomeyaml/dashboard/static/esphomeyaml.js b/esphomeyaml/dashboard/static/esphomeyaml.js index 4760712365..111e11340e 100644 --- a/esphomeyaml/dashboard/static/esphomeyaml.js +++ b/esphomeyaml/dashboard/static/esphomeyaml.js @@ -176,7 +176,7 @@ const fetchPing = () => { fetch('/ping', {credentials: "same-origin"}).then(res => res.json()) .then(response => { - for (let filename in response) { + for (let filename of response) { let node = document.querySelector(`.status-indicator[data-node="${filename}"]`); if (node === null) continue; @@ -474,7 +474,9 @@ downloadButton.addEventListener('click', () => { const link = document.createElement("a"); link.download = name; link.href = '/download.bin?configuration=' + encodeURIComponent(configuration); + document.body.appendChild(link); link.click(); + link.remove(); }); const cleanMqttModalElem = document.getElementById("modal-clean-mqtt");