IndexedDB用户权限 [英] IndexedDB User Permissions

查看:101
本文介绍了IndexedDB用户权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

早上好,所有

我在此页面上[使用IndexedDB]阅读: https ://developer.mozilla.org/zh-CN/docs/Web/API/IndexedDB_API/Using_IndexedDB

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

该浏览器将提示用户授予创建indexedDB的权限,并且用户可能拒绝该权限.参见下面的引用:

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

最可能的问题是用户决定不授予您的Web应用程序创建数据库的权限. 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.)

很显然,浏览器不想让某些广告网络或恶意网站污染您的计算机,因此浏览器会在任何给定的Web应用程序首次尝试打开IndexedDB进行存储时提示用户.用户可以选择允许还是拒绝访问.

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均未征得我的许可.并且数据库已成功创建(看来.)

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?

亲切的问候

推荐答案

本文已过时.根据您使用IndexedDB的方式,您可能永远不会收到提示 ,但这取决于浏览器,将来可能会发生变化.

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.

这篇关于IndexedDB用户权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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