diff --git a/assets/javascripts/app/db.coffee b/assets/javascripts/app/db.coffee
index 51fb1fa9..0bdf1909 100644
--- a/assets/javascripts/app/db.coffee
+++ b/assets/javascripts/app/db.coffee
@@ -29,6 +29,7 @@ class app.DB
@checkedBuggyIDB = true
catch
try db.close()
+ @reason = 'apple'
@onOpenError()
return
@@ -47,6 +48,7 @@ class app.DB
app.onQuotaExceeded()
else
@useIndexedDB = false
+ @reason or= 'cant_open'
@runCallbacks()
return
@@ -251,7 +253,11 @@ class app.DB
useIndexedDB: ->
try
- !app.isSingleDoc() and !!window.indexedDB
+ if !app.isSingleDoc() and window.indexedDB
+ true
+ else
+ @reason = 'not_supported'
+ false
catch
false
diff --git a/assets/javascripts/templates/error_tmpl.coffee b/assets/javascripts/templates/error_tmpl.coffee
index e36b94ad..ae060069 100644
--- a/assets/javascripts/templates/error_tmpl.coffee
+++ b/assets/javascripts/templates/error_tmpl.coffee
@@ -22,10 +22,19 @@ app.templates.bootError = ->
""" Check your Internet connection and try reloading.
If you keep seeing this, you're likely behind a proxy or firewall that blocks cross-domain requests. """
-app.templates.offlineError = ->
- error """ Oops, the database failed to load. """,
- """ DevDocs requires IndexedDB to cache documentations for offline access.
- Unfortunately IndexedDB is either not supported in your browser, disabled, or buggy. """
+app.templates.offlineError = (reason) ->
+ reason = switch reason
+ when 'not_supported'
+ """ Unfortunately your browser either doesn't support it or does not make it available. """
+ when 'cant_open'
+ """ Although your browser appears to support it, DevDocs couldn't open the database.
+ This could be because you're browsing in private mode and have disallowed offline storage on the domain. """
+ when 'apple'
+ """ Unfortunately Safari's implementation of IndexedDB is badly broken.
+ This message will automatically go away when Apple fix their code. """
+
+ error """ Oops, offline mode is unavailable. """,
+ """ DevDocs requires IndexedDB to cache documentations for offline access.
#{reason} """
app.templates.unsupportedBrowser = """