Skip to content

Commit

Permalink
Fix to artoo.save* in Firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
Yomguithereal committed Jul 12, 2016
1 parent 527b16f commit ca65d16
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/methods/artoo.methods.save.js
Expand Up @@ -76,12 +76,21 @@

a.setAttribute('download', params.filename || '');

artoo.$(a).simulate('click');
// Firefox needs the link attached to the page's DOM
if ('document' in _root)
document.body.appendChild(a);

a.click();

if ('document' in _root)
document.body.removeChild(a);
a = null;

// Revoking the object URL if we want to
if (params.revoke)
URL.revokeObjectURL(href);
setTimeout(function() {
URL.revokeObjectURL(href);
});
};

// Main interface
Expand Down

0 comments on commit ca65d16

Please sign in to comment.