<div dir="ltr"><div>For those who are curious like me, it looks like extension meta data is our first and so far only consumer of this:<br><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1344590">https://bugzilla.mozilla.org/show_bug.cgi?id=1344590</a><br><br>Kris, what lead you to wanting to use IndexedDB here? What are the tradeoffs compared to mozstorage or plain JSON (see sessionstore)?<br><br></div>dao<br></div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-26 4:27 GMT+02:00 Kris Maglione <span dir="ltr"><<a href="mailto:kmaglione@mozilla.com" target="_blank">kmaglione@mozilla.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">A couple of weeks ago, I added a new Promise-based IndexedDB helper module as part of some performance work I was doing:<br>
<br>
<a href="http://searchfox.org/mozilla-central/source/toolkit/modules/IndexedDB.jsm" rel="noreferrer" target="_blank">http://searchfox.org/mozilla-c<wbr>entral/source/toolkit/modules/<wbr>IndexedDB.jsm</a><br>
<br>
If you've been avoiding IndexedDB because of the verbose and<br>
difficult-to-work-with API, I encourage you to give it a try. There are<br>
a lot of advantages to using IndexedDB for storage, particularly the fully async API and use of structured clone for data serialization. With this module, a basic database access is as simple as:<br>
<br>
let db = await IndexedDB.open(<br>
"fooDB", {storage: "persistent", version: 1}, db => {<br>
db.createObjectStore("foo");<br>
});<br>
<br>
await db.objectStore("foo", "readwrite")<br>
.set("bar", {baz: "quux"});<br>
<br>
let val = await db.objectStore("foo").get("bar<wbr>");<br>
<br>
Please let me know if you have any questions or suggestions.<br>
<br>
-Kris<br>
______________________________<wbr>_________________<br>
firefox-dev mailing list<br>
<a href="mailto:firefox-dev@mozilla.org" target="_blank">firefox-dev@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/firefox-dev" rel="noreferrer" target="_blank">https://mail.mozilla.org/listi<wbr>nfo/firefox-dev</a><br>
</blockquote></div><br></div>