小编Pra*_*eep的帖子

在回调中使用cursor.continue()

我试图在chrome.tabs.update()回调中使用cursor.continue().我总是得到以下错误.

DOM IDBDatabase异常0错误:针对当前未处于活动状态或已完成的事务发出了请求.

Error in event handler for 'undefined': TransactionInactiveError: DOM IDBDatabase Exception 0 Error: A request was placed against a transaction which is either currently not active, or which is finished.
at chrome-extension://fiipdmhnjimefhdbdfpgllkckomakfkh/sample.js:62:20
at miscellaneous_bindings:288:9
at chrome.Event.dispatchToListener (event_bindings:390:21)
at chrome.Event.dispatch_ (event_bindings:376:27)
at chrome.Event.dispatch (event_bindings:396:17)
at Object.chromeHidden.Port.dispatchOnMessage (miscellaneous_bindings:254:22)     event_bindings:380
chrome.Event.dispatch_ event_bindings:380
chrome.Event.dispatch event_bindings:396
chromeHidden.Port.dispatchOnMessage
Run Code Online (Sandbox Code Playgroud)

码:

//background.js
store = getObjectStore(DB_STORE_NAME, 'readwrite');
var req;
req = store.count();

req.onsuccess = function(evt) {
  console.log('<p>There are <strong>' + evt.target.result +
                 '</strong> record(s) in the object …
Run Code Online (Sandbox Code Playgroud)

javascript google-chrome google-chrome-extension indexeddb

0
推荐指数
1
解决办法
1369
查看次数