fix firefox open export (#786)

main
Michael Fix 6 years ago committed by repo-ranger[bot]
parent 5acc71e2da
commit a58a860332

@ -97,6 +97,10 @@ class Editor extends React.Component {
window.navigator &&
window.navigator.userAgent.indexOf('Safari') !== -1 &&
window.navigator.userAgent.indexOf('Chrome') === -1
this.isFirefox =
window.navigator &&
window.navigator.userAgent.indexOf('Firefox') !== -1 &&
window.navigator.userAgent.indexOf('Chrome') === -1
}
carbonNode = React.createRef()
@ -225,6 +229,9 @@ class Editor extends React.Component {
if (format !== 'open') {
link.download = `${prefix}.${format}`
}
if (this.isFirefox) {
link.target = '_blank'
}
link.href = url
document.body.appendChild(link)
link.click()

Loading…
Cancel
Save