mirror of
https://github.com/daniel-j/fimfic2epub.git
synced 2024-09-30 00:56:13 +13:00
hotfix for firefox
This commit is contained in:
parent
500a5b2047
commit
8b7bec116d
2 changed files with 7 additions and 4 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "fimfic2epub",
|
"name": "fimfic2epub",
|
||||||
"version": "1.7.25",
|
"version": "1.7.26",
|
||||||
"description": "Tool to generate improved EPUB ebooks from Fimfiction stories",
|
"description": "Tool to generate improved EPUB ebooks from Fimfiction stories",
|
||||||
"author": "djazz",
|
"author": "djazz",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|
|
@ -59,10 +59,13 @@ function fetchBackground (url, responseType) {
|
||||||
|
|
||||||
export default function fetchRemote (url, responseType) {
|
export default function fetchRemote (url, responseType) {
|
||||||
if (url.startsWith('//')) {
|
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 fetchBackground(url, responseType)
|
||||||
}
|
}
|
||||||
return fetch(url, responseType)
|
return fetch(url, responseType).then((data) => {
|
||||||
|
if (!data) return fetchBackground(url, responseType)
|
||||||
|
else return Promise.resolve(data)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue