javascript - Detecting Available Storage with IndexedDB -
I have written an offline application which uses the IDB to store images and text that are usually used offline Is present in a MySQL DB for
However, I'm trying to explain one way that I can read the limits on devices memory for indexDB. I am currently using the following method to determine, though it only works in Chrome.
I'm using snippets from here, which comes in storageinfo for webkit, although if someone is ff & amp; IE & amp; Amp; More specifically the Safari who will be great.
Whatever I have collected, the quota used for everything that is stored by that browser not only for IDBI, however, what I am using is the Remaining Quota I Either request an AJAX request on the server to get the estimated size of all the files that will be stored and will work if there is sufficient storage or I will calculate the amount stored in IDB and if there It is enough to store more.
I was wondering if there was any more 'systematic' approach? And check the remaning quota in FF / IE and especially Safari & amp; amp; One way of testing for quotas specifically for IDB.
Many thanks!
Only API that is currently available and only for Chrome, Firefox is also meant to implement this API. There are also two experimental APIs I think the most interesting one is that it is still a draft, and is currently implementing this API. Unfortunately currently no public information is available when and if more Safari will implement this API. Currently there is a very different model for the edge quota - instead of the entire original limit, each storage type (indexed DB, local storage, etc.) has its own limit. Update: This feature has been added to Chrome 52 (Experimental Flag) and Firefox 51 (Night) navigator.webkitarmari storage.quariarias Andquata () .
navigator.story quota.Carinfo (type) and
navigator.storoz. ( available) If you use Chrome as
- enabled-experimental-web-platform-features More details here:
Navigator.storage.stem (). Then ((data) = & gt; console.log (data)) / object {quota: 2147483648, use: 0}
Comments
Post a Comment