IndexedDB 用户权限

IndexedDB User Permissions

大家好

我在这个页面上阅读 [使用 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,但这取决于浏览器,将来可能会发生变化。