indexeddb

When can I tell that I have opened a connection in indexedDB?

最后都变了- 提交于 2019-12-11 07:43:44
问题 In the getCursor_ function below, please explain how I could determine if IndexedDb has opened and if not re-run function once it has? The getCursor_ runs correctly. However, since all of these calls are asynchronous, the function fails when executing before the database has completed opening. This code is executed in a separate process: var ixDb; var ixDbRequest; ixDbRequest = window.indexedDB.open(dbName, dbVersion); ixDbRequest.onsuccess = function (e) { ixDb = ixDbRequest.result || e

Access to the Indexed Database API is denied in this context

大兔子大兔子 提交于 2019-12-11 07:36:12
问题 I'm getting an exception when I try to access IndexedDB in Chrome with Service Workers. I'm not using a web server so I execute my html files locally onto browser so my url is something like file:///D:/Dev/web/sample-sw/index.html I don't know why the code works on Firefox but it doesn't on Chrome. This is the exception: Unhandled rejection: OpenFailedError: SecurityError Failed to execute 'open' on 'IDBFactory': access to the Indexed Database API is denied in this context. My index.html is

indexedDB has bad performance on iOS?

橙三吉。 提交于 2019-12-11 07:34:12
问题 When I read data (in my case more then 3000 items) from indexedDB it works so slow. And it doesn't matter what browser I use. I got the same results on Chrome and Safari. I used iPad 3 for testing. In scope of this issue I've found out the following interesting things: When I open my client application on the desktop version of Chrome it works in appropriate way . In case when I use WebSQL in Safari it looks fine BUT when I use indexedDB in Safari it worked SLOW . When we've used Chrome on

Error “The object store currently does not support blob values” when trying to store file in indexedDB

∥☆過路亽.° 提交于 2019-12-11 07:08:08
问题 I'm trying to make a storage in javascript using IndexedDB to store blobs. Here is my code var Storage = (function () { function Storage(callback) { var indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB, IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction, dbVersion = 1.0; this.URL = window.URL || window.webkitURL; var request = indexedDB.open('files',

Is there any way to detect that indexed db is blocked due readwrite or versionchange in multiple tab

╄→гoц情女王★ 提交于 2019-12-11 04:44:13
问题 Is there any way to detect that indexed db is blocked due readwrite or versionchange locks in multiple tab.how to detect the lock is released and then continue with readwrite or versionchange operations. 回答1: To detect that an indexedDB database is blocked in another tab, you can listen for the blocked event when connecting to the database. const request = indexedDB.open(...); request.onblocked = function(event) { console.log('blocked :('); }; As Mr. Bell states in the comments, a block event

Error “Data provided to an operation does not meet requirements” when trying to add data to indexedDB

浪子不回头ぞ 提交于 2019-12-11 03:48:34
问题 I have no idea what's wrong with this code: onupgradeneeded = function(){ z = e.currentTarget.result.createObjectStore( 'record', {keyPath:'id',autoIncrement:true} ); z.createIndex('book', 'book', {unique:false}); z.createIndex('user', 'user', {unique:false}); } When I try to put data into the object store using the following code: db.transaction('record',IDBTransaction.READ_WRITE) .objectStore('record') .add({book:...,user:...}) I receive the following error message: Data provided to an

Open PDF from HTML5 Storage

假如想象 提交于 2019-12-11 03:26:35
问题 I want to store pdf files client side in one of the HTML5 storages (indexedDB or localstorage) and then open them later with the adobe reader. The scenario is as follows: The user visites my site and downloads a bunch of pdf's into a storage Later the user revisits the site and wants to view one of the pre downloaded pdf's. He chooses one of the stored pdf's and it gets rendered with the adobe reader (or the default pdf renderer). Is this possible with pure html5/js or do i have to write a

IndexedDB over local HTML file

 ̄綄美尐妖づ 提交于 2019-12-11 02:37:36
问题 I would like to develop an application which uses a browser to interact with the user. The application is to be available offline and distributable via a zip. The functions I would like to perform are to be handled by HTML, CSS, JS and I would like to make use of the IndexedDB functionality. I have hit a problem with IndexedDB (Chrome) in that the same code works in an online space but not from a local hard drive location (file://). Refer to example: http://jsfiddle.net/FwuUD/ (function() {

IndexedDB - Dexie JS : Dynamically create stores

江枫思渺然 提交于 2019-12-11 00:29:38
问题 I'm working with indexedDB for local data storage, with Dexie.js which is pretty nice as a wrapper, especially because of the advanced queries. Actually, I would like to create to create several datastore by script, which seem complicated. To create a new store, you would do something like : db.version(2).stores({ Doctors: "++" + strFields }); If I do something like Doctors = "Hospital", it still creates the store with a name "Doctors". Is there a way to do this? Did anybody faced the same

Generating UUIDs for IndexedDB keys?

喜夏-厌秋 提交于 2019-12-10 23:57:13
问题 The W3C spec for IndexedDB defines a key generator as: A key generator generates a monotonically increasing numbers [sic] every time a key is needed. Now, it seems (to me) that a common use case for IndexedDB (or, for that matter, any of the HTML5 client-side storage options: WebSQL, localStorage etc.) would be apps designed to work offline (in conjunction with HTML5 ApplicationCache). In this scenario, a disconnected web application might generate new objects/records in it's local data store