[英]How do I set the initial database size with IndexedDBShim?
I am using the polyfill IndexedDBShim to create a database on iOS Safari 7.1.我正在使用 polyfill IndexedDBShim在 iOS Safari 7.1 上创建一个数据库。 However, it throws an error in indexeddbshim.min.js (line 118) and then tells me:但是,它在 indexeddbshim.min.js(第 118 行)中引发错误,然后告诉我:
"Application cache update failed, because size quota was exceeded."
despite the entire app being 1.06 MB.尽管整个应用程序只有 1.06 MB。 But I think indexeddbshim is requesting too large a size to start (I believe in iOS 7.1, you need to first request less than 5MB in WebSQL to start before increasing it after)但我认为 indexeddbshim 请求的大小太大而无法启动(我相信在 iOS 7.1 中,您需要先在 WebSQL 中请求小于 5MB 才能启动,然后再增加它)
All I can find is this:我能找到的只有这个:
var request = indexedDB.open( "mydbname", 1.0 );
If I try adding in a size variable it doesn't work, and neither does the "const" I found someone else mention online:如果我尝试添加大小变量,它不起作用,而且我在网上找到其他人提到的“const”也不起作用:
//Neither of these options work
var DEFAULT_DB_SIZE = 1 * 1024 * 1024;
var request = indexedDB.open( "mydbname", 1.0, DEFAULT_DB_SIZE );
How can I set the WebSQL initial size?如何设置 WebSQL 初始大小?
Inside the indexeddbshim.js file, there is a line like this:在 indexeddbshim.js 文件中,有这样一行:
var DEFAULT_DB_SIZE = 4 * 1024 * 1024;
which corresponds to an initial size of 4MB (in version 2.2.1 of the unminified file it is in line 2996).它对应于 4MB 的初始大小(在未缩小文件的 2.2.1 版中,它位于第 2996 行)。
Edit this line inside indexeddbshim.js to be a different value, and then retry.将 indexeddbshim.js 中的这一行编辑为不同的值,然后重试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.