IndexedDB User Permissions

六眼飞鱼酱① 提交于 2019-12-10 15:50:54

问题


Good day, all

I read on this page [Using IndexedDB]: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB

that browser will prompt user to give permission to create indexedDB, and the user may deny permission. See quote below:

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.

However, when testing on my localhost, neither Firefox nor Google Chrome asked me for permission. And the db was created successfully (it seems.)

So, is that article outdated? Or is it because I'm testing on localhost? or something else I'm missing?

Kind Regards


回答1:


The article is outdated. Depending on how you use IndexedDB, you might never get a prompt, but it depends on the browser and that could change in the future.



来源:https://stackoverflow.com/questions/30872202/indexeddb-user-permissions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!