From 8b566f205bc453f69d5f1ff217c838cf3c69f6c4 Mon Sep 17 00:00:00 2001 From: Thibaut Courouble Date: Sat, 22 Apr 2017 09:02:29 -0400 Subject: [PATCH] Improve IDB error handling for Firefox private mode --- assets/javascripts/app/db.coffee | 2 ++ assets/javascripts/templates/error_tmpl.coffee | 3 +++ 2 files changed, 5 insertions(+) diff --git a/assets/javascripts/app/db.coffee b/assets/javascripts/app/db.coffee index f2ddb3f6..28e4b0ea 100644 --- a/assets/javascripts/app/db.coffee +++ b/assets/javascripts/app/db.coffee @@ -49,6 +49,8 @@ class app.DB @onQuotaExceededError() when 'VersionError' @onVersionError() + when 'InvalidStateError' + @fail 'private_mode' else @fail 'cant_open', error return diff --git a/assets/javascripts/templates/error_tmpl.coffee b/assets/javascripts/templates/error_tmpl.coffee index cfd49466..9dc311d9 100644 --- a/assets/javascripts/templates/error_tmpl.coffee +++ b/assets/javascripts/templates/error_tmpl.coffee @@ -33,6 +33,9 @@ app.templates.offlineError = (reason, exception) -> when 'buggy' """ DevDocs requires IndexedDB to cache documentations for offline access.
Unfortunately your browser's implementation of IndexedDB contains bugs that prevent DevDocs from using it. """ + when 'private_mode' + """ Your browser appears to be running in private mode.
+ This prevents DevDocs from caching documentations for offline access.""" when 'exception' """ An error occured when trying to open the IndexedDB database:
#{exception.name}: #{exception.message} """