-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
indexedDB instead of localStorage for plugins #174
Comments
ohhhh.... I found this about limits "Maximum storage size depends on 2 things, Browser and Disk space." 🥇 from here!!! const quota = await navigator.storage.estimate(); |
Ok this is also interesting, i made this small function to check the usage: function logIndexedDBUsage() {
navigator.storage.estimate().then(d => {
let usage = Math.round(d.usage / d.quota * 1000)/10;
console.log("indexedDB usage: "+usage+" %")
})
} it shows me 2.9% |
just small part of map here 66mb size and console say to me indexedDB usage: 3 % / browser Brave take from RAM around 3.5Gb , total ram of PC usage ~7.5%. I will ask for some BIGBROTHERS to do test... :D |
We could provide an API for this in |
Thanks for the reply! An official API sounds great. Some ideas: |
I did some research and found out that there is another way to store data on the client side.
We don't want to use localStorage because it contains the private key, but what about indexedDB?
It takes much more code to use it but I tried to make a small code example for people to use:
The 2 functions can be used to load and save one object to the database, inside the object you can put whatever you want (i think). But there is of course a size limit on how much you can store in the DB. The indexedDBName should be different for each plugin.
What do you think? Can this be used?
The text was updated successfully, but these errors were encountered: