Disable offline access if application cache is not available, rather than failing. Apparently the next version of Firefox will disable app cache on HTTP sites. See https://bugs.launchpad.net/calibre/+bug/1737642

This commit is contained in:
Kovid Goyal 2018-09-02 08:53:51 +05:30
parent 1f2db06610
commit d703d0ec56
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -46,9 +46,12 @@ else:
print('WARNING: failed to swap applicationCache')
console.log(e)
if window.applicationCache:
window.applicationCache.addEventListener('updateready', on_appcache_ready)
if window.applicationCache.status is window.applicationCache.UPDATEREADY:
on_appcache_ready()
else:
console.warn("Your browser does not have a working Application Cache, offline access will not work")
script = document.currentScript or document.scripts[0]
main_js(script.textContent)
script.parentNode.removeChild(script) # save some memory