cheerp-meta icon indicating copy to clipboard operation
cheerp-meta copied to clipboard

Add support for the second edition of the IndexedDB API

Open HighCommander4 opened this issue 9 years ago • 4 comments

The IndexedDB API has a second edition which supports some new methods like IDBObjectStore.getAllKeys(). It would be nice if Cheerp exposed these new methods.

HighCommander4 avatar Mar 26 '16 05:03 HighCommander4

Thanks for reporting this, we will add support for this in the next release. In general you should be able to extend Cheerp to currently non stock supported API by declaring the appropriate classes in the client namespace. See https://github.com/leaningtech/cheerp-meta/wiki/Browser-side-programming-guide#accessing-the-dom-under-the-hood for an example.

alexp-sssup avatar Mar 27 '16 17:03 alexp-sssup

In this case, the new functionality is not a new class, but a new method of an existing class (IDBObjectStore). Is that still something I can declare myself?

HighCommander4 avatar Mar 30 '16 00:03 HighCommander4

You should be able to derive a new class from the original one and access the new method by pointer casting.

alexp-sssup avatar Apr 04 '16 09:04 alexp-sssup

Thanks, that works!

I assume I should keep the report open to track Cheerp adding support for it directly.

HighCommander4 avatar Apr 05 '16 06:04 HighCommander4

IDBObjectStore.getAllKeys() was added in https://github.com/leaningtech/cheerp-utils/commit/71a1a5411b678dfaaebef354de71ab3cafe98bae

DutChen18 avatar Mar 07 '24 15:03 DutChen18