indexeddb

Example of memory leak in indexedDB at store.add (see Example at Edit)

a 夏天 提交于 2019-12-25 02:13:35
问题 I'm struggling to understand why this code generates a memory leak, or at least what appears to be a memory leak. I'm attempting to write a portfolio of quiz objects to an indexedDB database. At this stage, I'm just trying to test the speed of writing different numbers of quizzes of different sizes. Included is only the portion of the code that writes to the database. The port.quiz[] object is defined globally. The code is set up to display messages as each quiz is successfully written and a

How do I read an objects key in an indexeddb autoincrement objectstore, given an index

自古美人都是妖i 提交于 2019-12-25 02:13:05
问题 This question in code form, I can use .put(doc, key) to overwrite the object, but I cant figure out how to read its key // After writing doc1 to an autoincrement // objectStore, I want to overwrite it // later, I only know its index // (not its key) var docs = [ {'a':'doc1', 'my_index': 'anindex'}, {'a':'doc2', 'my_index': 'anindex'} ]; indexedDB.deleteDatabase('foo').onsuccess = function () { var idb; var req = indexedDB.open('foo'); function writeDocs(docs) { if (!docs.length) { console.log

Chrome Developer Tools IndexDb filter - items disappear

依然范特西╮ 提交于 2019-12-24 22:03:21
问题 Working with Chrome version 35.0.1916.153 m , when I open Resources/IndexedDB and I select a table, all the items appear properly, but as soon as I write something in the input search box the items disappear from the list. The items are not removed from the IndexDB, but to see them again I need to restart Chrome. Any idea? 回答1: See probable duplicate Chrome console keeps getting stuck in a quirky state. See https://code.google.com/p/chromium/issues/detail?id=379483 for insight. The problem

I seem to be getting a dirty read from an IndexedDB index. Is this possible?

只愿长相守 提交于 2019-12-24 20:27:10
问题 I have some js that does a put to IndexedDB (in Chrome) using a readwrite transaction, then immediately queries from the same indexedDB objectstore using an index and a readonly transaction. Sometimes, the results I get back do not include the changes from my put and other times they. Is this sort of dirty ready to be expected in IndexedDB? Is there a way to avoid it? Perhaps it's because I'm using 2 different txns and should be using just one (the reason for that is these calls are actually

Making localStorage and/or IndexedDB data offline permanent?

南楼画角 提交于 2019-12-24 20:13:55
问题 Is it possible to make localStorage and/or IndexedDB offline data permanent? I am planning to make a completely offline HTML5 app and want the data to never get deleted, unless and otherwise the user knowingly does so. I do not want the data to be deleted even after the app is closed, system is shutdown or something like CCleaner is run. 回答1: What you are looking is persistent storage as defined in Quota Management API. Currently none of the browser implemented it. However IndexedDB data,

Manually replaying requests queued by workbox-background-sync

微笑、不失礼 提交于 2019-12-24 09:08:04
问题 I am working on offline support in my PWA app. I am using workbox for that. This is my current code: const addToFormPlugin = new workbox.backgroundSync.Plugin('addToForm'); workbox.routing.registerRoute( RegExp('MY_PATH'), workbox.strategies.networkOnly({ plugins: [addToFormPlugin] }), 'POST' ); The code seems to works fine on my computer. However, once I run the app on the phone it takes ages to upload requests stored in IndexedDB. I know that it happens on the SYNC but it seems to take at

Reading indexedDB data and file in IE 11

时光毁灭记忆、已成空白 提交于 2019-12-24 04:22:23
问题 I'm trying to locate where IE 11 is storing indexedDB file(s). Does anyone know the location? Futhermore, in Chrome, I'm able to look at the indexedDB via developer tools, navigate the different stores and query the database. Does anyone know if IE 11 offers this capability? 回答1: For Debugging in IE, you can use an external library as described here -http://blogs.msdn.com/b/ie/archive/2012/01/25/debugging-indexeddb-applications.aspx You need to embed an iframe in your application, from where

IndexedDB IDBKeyRange Compound/Multiple Index not working

我们两清 提交于 2019-12-24 04:22:18
问题 Can anyone explain why my IDBKeyRange only seems to be filtering on the first column? I have an index defined as follows: osDrugs.createIndex("combined", ["name", "strength", "form", "packsize"], {unique: false}); My query is roughly as follows: var transaction = pimsDB.transaction("drugs"); var objectStore = transaction.objectStore("drugs"); var range = IDBKeyRange.bound([tmpName, tmpStrength, tmpForm, tmpPack],[tmpName+"z", tmpStrength + "z", tmpForm+"z", tmpPack+"z"]); var index =

Reading indexedDB data and file in IE 11

和自甴很熟 提交于 2019-12-24 04:21:56
问题 I'm trying to locate where IE 11 is storing indexedDB file(s). Does anyone know the location? Futhermore, in Chrome, I'm able to look at the indexedDB via developer tools, navigate the different stores and query the database. Does anyone know if IE 11 offers this capability? 回答1: For Debugging in IE, you can use an external library as described here -http://blogs.msdn.com/b/ie/archive/2012/01/25/debugging-indexeddb-applications.aspx You need to embed an iframe in your application, from where

IndexedDb per multiple users

百般思念 提交于 2019-12-24 02:43:15
问题 I have a question about IndexedDb best practices, how to manage different users' data. Scenario: I have a mysql database containing system data. When user login to the system, I synchronize his data from mysql into IndexedDb and then web application uses data stored directly in indexeddb. When user login next time to the system, full synchronization is not needed because his data is already stored locally. Problem is when user logs out, and then on the same computer another user login into