Open calvin2021y opened 1 year ago
What would it be backed by?
sqlite or levelDB ?
One SQLite is added to the core indexedDB could potentially be shimmed.
SQLite support landed: https://github.com/saghul/txiki.js/pull/395
Think we first need to impl structural clone that can clone complex object to/from arraybuffers or something first. IndexedDB can contain complex types such as TypedArrays Blobs circular refs Object literals regex and much more.
If i remember correctly chrome used sqlite + cbor for storing stuff in? or maybe it was their own impl. of v8.serialize/deserialize... don't remember.
For structuredClone support please follow https://github.com/quickjs-ng/quickjs/issues/16
Once we have it in QuickJS we can update here.
or maybe it was their own impl. of v8.serialize/deserialize...
I think it's this (or was, at least). I earned a $15k bug bounty last year for a bug in the deserializer that was exploitable across sandboxes. /tangent
For structuredClone support please follow quickjs-ng/quickjs#16
Once we have it in QuickJS we can update here.
FYI, I added structuredClone here. It's pretty small, so I could port it to QuickJS, but in order to be correct we'd need DOMException, which I'm a bit more in doubt about, plus the version we'd ship doesn't work for other clonable things QuickJS doesn't have...
Anyway, if someone wants to give it a try, all the ducks should be in a row now :-)
can add indexedDB implement into txiki.js ?