浏览代码

Wrap app.DB#useIndexedDB in try/catch

Thibaut 11 年之前
父节点
当前提交
eecbade78e
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      assets/javascripts/app/db.coffee

+ 4 - 1
assets/javascripts/app/db.coffee

@@ -221,7 +221,10 @@ class app.DB
     return
 
   useIndexedDB: ->
-    !app.isSingleDoc() and !!window.indexedDB
+    try
+      !app.isSingleDoc() and !!window.indexedDB
+    catch
+      false
 
   indexedDBVersion: ->
     if app.config.env is 'production' then app.config.version else Date.now() / 1000