hotfix for firefox

This commit is contained in:
Daniel Jönsson 2018-03-16 11:09:30 +01:00
parent 500a5b2047
commit 8b7bec116d
2 changed files with 7 additions and 4 deletions

View file

@ -1,6 +1,6 @@
{
"name": "fimfic2epub",
"version": "1.7.25",
"version": "1.7.26",
"description": "Tool to generate improved EPUB ebooks from Fimfiction stories",
"author": "djazz",
"license": "MIT",

View file

@ -59,10 +59,13 @@ function fetchBackground (url, responseType) {
export default function fetchRemote (url, responseType) {
if (url.startsWith('//')) {
url = 'http:' + url
url = 'https:' + url
}
if (!isNode) {
if (!isNode && document.location.protocol === 'https:' && url.startsWith('http:')) {
return fetchBackground(url, responseType)
}
return fetch(url, responseType)
return fetch(url, responseType).then((data) => {
if (!data) return fetchBackground(url, responseType)
else return Promise.resolve(data)
})
}