大家好
我在这个页面上读到 [使用 IndexedDB]:https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB
浏览器会提示用户授予创建indexedDB的权限,用户也可以拒绝权限。请参阅下面的引述:
The most likely problem is that the user decided not to give your web app permission to create a database. One of the main design goals of IndexedDB is to allow large amounts of data to be stored for offline use. (To learn more about how much storage you can have for each browser, see Storage limits.)
Obviously, browsers do not want to allow some advertising network or malicious website to pollute your computer, so browsers prompt the user the first time any given web app attempts to open an IndexedDB for storage. The user can choose to allow or deny access.
但是,在我的本地主机上进行测试时,Firefox 和 Google Chrome 都没有征求我的许可。并且数据库已成功创建(似乎。)
那么,那篇文章过时了吗?还是因为我在本地主机上测试?还是我缺少的其他东西?
亲切的问候
最佳答案
这篇文章已经过时了。根据您使用 IndexedDB 的方式,you might never get a prompt ,但这取决于浏览器,并且将来可能会发生变化。
关于javascript - IndexedDB 用户权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30872202/