From e20232a869a60e5bd75da9c216256db232506dcc Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Fri, 20 Jul 2018 23:51:05 -0700 Subject: [PATCH] Closes #692 - Fixes download files in Firefox --- app/models/Document.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/models/Document.js b/app/models/Document.js index 9b240c0b..0336d2f7 100644 --- a/app/models/Document.js +++ b/app/models/Document.js @@ -275,6 +275,9 @@ class Document extends BaseModel { const blob = new Blob([unescape(this.text)], { type: 'text/markdown' }); const url = URL.createObjectURL(blob); const a = document.createElement('a'); + + // Firefox support requires the anchor tag be in the DOM to trigger the dl + if (document.body) document.body.appendChild(a); a.href = url; a.download = `${this.title}.md`; a.click();