Javascript &引用;由于页面导航,尚未完成的IndexedDB事务已中止;

Javascript &引用;由于页面导航,尚未完成的IndexedDB事务已中止;,javascript,firefox,indexeddb,Javascript,Firefox,Indexeddb,我正在使用IndexedDB来存储一些数据。它似乎可以工作,但如果我刷新页面,我会看到:由于页面导航,尚未完成的IndexedDB事务已中止。在Firefox(36.0.4)上的浏览器控制台中。我正在使用此(本地)文件测试: <html> <head><meta charset="UTF-8"></head> <body> <script> var request = window.indexedDB.ope

我正在使用IndexedDB来存储一些数据。它似乎可以工作,但如果我刷新页面,我会看到:
由于页面导航,尚未完成的IndexedDB事务已中止。
在Firefox(36.0.4)上的浏览器控制台中。我正在使用此(本地)文件测试:

<html>
  <head><meta charset="UTF-8"></head>
  <body>
    <script>
var request = window.indexedDB.open("test_db", 2);
request.onupgradeneeded = function (event) {
  request.result.createObjectStore("test_store");
};

request.onsuccess = function (event) {
  var db = request.result;
  var transaction = db.transaction(["test_store"], "readwrite");
  var put = transaction.objectStore("test_store").put("key", "value");
  transaction.oncomplete = function (event) {
    console.log("Transaction complete");
  };
};
    </script>
  </body>
</html>
测试页面(Ctrl-Shift-J打开控制台,然后Ctrl-R刷新显示错误):

错误,现在已经修复:

状态:已解决或已修复

修复是在Firefox41上完成的

跟踪标志:状态-firefox41:已修复


若您的“oncomplete”正在启动,那个么IndexedDb似乎认为事务已经完成。在清除浏览器缓存后,是否会立即发生这种情况?是否可以制作一个网页来重现您的问题?这可能是浏览器错误。@KyawTun我在问题末尾添加了一个指向测试页面的链接。我使用一个新的Firefox配置文件进行了测试。这里报告为一个bug:在
41
中修复,稳定版本将于2015年9月发布。
"Transaction complete" test.html:16:1
An IndexedDB transaction that was not yet complete has been aborted due to page navigation. test.html:13:0
"Transaction complete" test.html:16:1
An IndexedDB transaction that was not yet complete has been aborted due to page navigation. test.html:13:0
"Transaction complete" test.html:16:1