有没有办法在Google Chrome中增加localStorage的大小以避免QUOTA_EXCEEDED_ERR:DOM Exception 22 [英] Is there a way to increase the size of localStorage in Google Chrome to avoid QUOTA_EXCEEDED_ERR: DOM Exception 22

查看:690
本文介绍了有没有办法在Google Chrome中增加localStorage的大小以避免QUOTA_EXCEEDED_ERR:DOM Exception 22的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个web应用程序,允许您将图像存储在localStorage中,直到您点击保存为止(因此,如果信号不佳,它可以离线运行)。

I've written a webapp that allows you to store the images in the localStorage until you hit save (so it works offline, if signal is poor).

当localStorage达到5MB时Google Chrome在javascript控制台日志中产生一个错误:
$ b

When the localStorage reaches 5MB Google Chrome produces an error in the javascript console log:


未捕获错误:QUOTA_EXCEEDED_ERR:DOM异常22

Uncaught Error: QUOTA_EXCEEDED_ERR: DOM Exception 22

如何增加Google Chrome浏览器上localStorage配额的大小?

How do I increase the size of the localStorage quota on Google Chrome?

推荐答案

你不能,它的硬件线路为5MB。这是Chrome开发人员的设计决定

You can't, it's hard-wired at 5MB. This is a design decision by the Chrome developers.

在Chrome中,默认情况下,Web SQL数据库和缓存清单也具有较低的限制,但如果您为Chrome App Store打包应用您可以增加它们

In Chrome, the Web SQL db and cache manifest also have low limits by default, but if you package the app for the Chrome App Store you can increase them.

另请参阅< a href =https://developer.chrome.com/apps/offline_storage =nofollow noreferrer>管理HTML5离线存储 - 谷歌浏览器。

这篇关于有没有办法在Google Chrome中增加localStorage的大小以避免QUOTA_EXCEEDED_ERR:DOM Exception 22的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆