HTML5 Database - increase size above 5mb without prompting to user - html

Is there anyway to change the html5 DB storage space from 5mb without asking the user ? (I'm interested most for Firefox browser)

Short answer is no.
You could however use IndexedDB...
IndexedDB:
Browsers will ask the user for permission if the DB tries to use more than their specified limit (50MB in Firefox's case I think). Once permission is obtained there is no further permission requests though.
LocalStorage:
The limit is 5MB for all browsers. This cannot be changed.

Related

how to make data offline permanent

Making localStorage and/or IndexedDB data offline permanent?
Is it possible to make localStorage and/or IndexedDB offline data permanent?
I am planning to make a completely offline HTML5 app and want the data to never get deleted, unless and otherwise the user knowingly does so.
I do not want the data to be deleted even after the app is closed, system is shutdown.
...want the data to never get deleted, unless and otherwise the user
knowingly does so.
The Storage API allow requesting a "persistent" permission for your origin. If granted, the semantics are that the data stored in certain APIs (local storage, Indexed DB, Cache, etc) is preserved until an explicit user action (like clearing storage), which appears to match your needs.
Documentation:
https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/persist
Note that this is a new web platform API. It was recently added to Firefox (57) and Chrome (55), but is not present in Edge or Safari. Also note that Chrome does not currently show prompts for this permission request; it uses heuristics about the web app to determine if the request should be granted or not rather than asking the user to make the decision.
The specification is at: https://storage.spec.whatwg.org
The spec gives a background on how storage could work in browsers, i.e. by default an origin's data is "best effort", meaning preserved until the browser needs to clear it (due to space constraints, etc). The actual behavior of browsers varies significantly.

Is there a way to Increase HTML5 Storage quota

I've been trying and searching for a way to increase the native quota on Safari (both iOS & Desktop), and Chrome, I've tried with no success and searched almost everywhere.
I'm working on a web-app that supposed to work offline most of the time, so at the user's first login, I retrieve the contents and store them within pre-defined databases (using IndexedDB), the problem here is that the app's content may be larger than 30MB.
Is there any way to prompt the user to increase his quota so it fits my app's needs, as long as I understand that there's no way to force a specific quota with out his permission ?
Thanks in advance.
With Chrome (and soon Firefox) you can use APIs to query the quota and how much is used:
From Chrome M61 on (and future Firefox) - spec:
navigator.storage.estimate().then(
(used, total) => console.log(
`using ${used} out of ${total}, or ${used/total*100}%`
)
);
Older Chrome only:
navigator.webkitTemporaryStorage.queryUsageAndQuota(
(used, total) => console.log(
`using ${used} out of ${total}, or ${used/total*100}%`)
);
How much quota an origin is granted by Chrome varies depending on device storage capacity (to balance multiple competing sites and not fill the device). There is no API or prompt to increase storage.
Safari doesn't support the estimate() API yet and likely has different rules/heuristics for granting quota.

HTML5 sessionStorage limits?

A few questions regard HTML5's sessionStorage:
Does the 5MB limit on localStorage include sessionStorage? (ie. is it really a 5MB limit on the WebStorage API)
If not does sessionStorage have a maximum size limit similar to localStorage?
I found this site http://dev-test.nemikor.com/web-storage/support-test/ in another SO questions, I'm wondering if the data is still relevant?
Does the 5MB limit on localStorage include sessionStorage? (Answer: NO)
is it really a 5MB limit on the WebStorage API (Answer: NO; Supported By )
does sessionStorage have a maximum size limit similar to localStorage? (Answer: NO; Supported By )
Hope I answered all your questions in a simplified manner. Here is a particularly informative section for you:
QUOTAS
You can imagine the chaos if any website was allowed to
populate unsuspecting hard drives with gigabytes of data! Thus,
browsers impose limits on storage capacity. When your app attempts to
exceed that limit, the browser will typically show a dialog to let the
user confirm the increase. You might expect the browser to enforce a
single limit for all storage an origin can use, but the major browsers
are actually enforcing limits separately for each storage mechanism.
This may change in the future, but for now, you should think of the
browser as maintaining a 2-D matrix, with "origin" in one dimension
and "storage" in the other. For example, "http://abc.example.com" is
allowed to store up to 5MB of Web Storage, 25MB of Web SQL Database
Storage, and forbidden to use Indexed Database. Another welcome
enhancement in this area would be user interfaces to let users view
and control how much space they have allocated for each origin. There
are also environments where the user can see upfront how much storage
will be used, e.g. in the case of the Chrome Web Store, when a user
installs an app, they will be prompted upfront to accept its
permissions, which include storage limits. One possible value is
"unlimited_storage".
The above text taken from http://www.html5rocks.com/en/tutorials/offline/storage/

Increasing 5MB Storage Limit in Chrome

We have a POS app written in html5 and we are using the localStorage to store orders and other info.
I am experiencing the limits of the 5MB that chrome offers and it is causing the app to crash.
Is there an easy way to increase this limitation?
thanks
Check this link, it discusses your problem and it might help you
The db file path for chromium and chrome on windows vista look like...
C:\Users\<username>\AppData\Local\Chromium\User Data\Default\Application Cache\Index
C:\Users\<username>\AppData\Local\Google\Chrome\User Data\Default\Application Cache
Here's the sql statement to run...
insert into Quota values("http://127.0.0.1:8008/", 100000000);
You can run that command using the sqlite3 command line tool available
here, http://www.sqlite.org/download.html. Put whatever origin url you'd to
give more storage to in there.
No, there is no way to increase 5MB localStorage per-domain limit. You can use IndexedDB instead for storing your data, though. Read more: IndexedDB and Limits

Mobile Safari 5mb HTML5 application cache limit?

It's becoming evident in my testing that there's a 5mb size limit on Mobile Safari's implementation of HTML5's application cache.
Does anyone know how to circumvent or raise this? Is there some unexposed meta tag that I should know about? I have to cache some video content for an offline app and 5mb is not going to be enough.
I tried to write a simple test with this manifest:
CACHE MANIFEST
# 2010-06-20:v4
http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
http://peach.blender.org/wp-content/uploads/big_big_buck_bunny.jpg
http://apod.nasa.gov/apod/image/9712/orionfull_jcc_big.jpg
http://www.thelivingmoon.com/43ancients/04images/Titan/titan5km_huygens_big.jpg
http://upload.yeuamnhac.com/musica/dan_lily/dancontent/rh108poster1big.jpg
This cache will need 11.4MB of storage.
When I open a page include that manifest file, it say something like that: "This website require to use up to 25MB of storage, do you want to increase local storage?".
I think I got what the way iOS do:
You only have 5MB for local storage (include HTML5 application cache)
If your web need more, Safari need user's agreement for some packages (up to 10MB, or 25MB, or more...)
Hope that useful for you.
This won't apply to the particular offline-video use case, but you can create Web SQL databases larger than the default 5MB in iOS by simply requesting a larger DB in the openDatabase call. For some kinds of storage, SQLite can be an acceptable solution.
Also contacted apple about this.
Read my blogpost about this here: http://techblog.viewbook.com/2011/02/mobile-safari-offline-application-cache-limit/
And my StackOverflow post here: Max size iPad / iPhone Offline Application Cache
What else is on the page?
These guys keep their pages under the limit by either splitting up the pages or replacing some of the cached images with links:
http://www.mobilenoter.com/blog/post/2010/04/06/Removing-size-limit-of-a-page.aspx
I ran a web app that was larger then 5MB on an iPad (iOS 5) although it is an iPad once the page loaded past 5MB it presented a pop-up asking the user if he/she wanted to increase the size of the cache to 10MB.
I would appear that with the latest iOS version that if a web app needs more then 5MB of cache storage it will ask the user if it has permission to increase it so the user can manage his/her own memory space.
It would also stand to reason that when you view your usage data (say via iTunes) the amount you see in the "Other" category is probably web cache mostly. Also you can see how much space is being used per website by going to Settings | Safari | Advanced | Website Data.
Not sure why every forgets about the good 'ol Web apps (remember these guys? they were around before native apps!), but they're already "offline ready," which means that you don't need to load up your application cache with every component of your app.
To the best of my knowledge, there is no limit to the size of web apps.
http://www.apple.com/webapps/