   shouldLoadWithIDB: (entry) ->
     @useIndexedDB and (not @cachedDocs or @cachedDocs[entry.doc.slug])
 
+  idbTransaction: (db, options) ->
+    txn = db.transaction(options.stores, options.mode)
+    unless options.ignoreError is false
+      txn.onerror = (event) ->
+        event.preventDefault()
+        return
+    unless options.ignoreAbort is false
+      txn.onabort = (event) ->
+        event.preventDefault()
+        return
+    txn
+
   reset: ->
     try indexedDB?.deleteDatabase(NAME) catch
     return

        onError()
        return

      txn = db.transaction [entry.doc.slug], 'readonly'
      store = txn.objectStore(entry.doc.slug)

      req = store.get(entry.dbPath())

  loadDocsCache: (db) ->
    @cachedDocs = {}

    txn = @idbTransaction db, stores: ['docs'], mode: 'readonly'
    store = txn.objectStore('docs')

    req = store.openCursor()
