gpt4 book ai didi

javascript - chrome.storage.local 的数据限制

转载 作者:行者123 更新时间:2023-12-05 07:47:42 26 4
gpt4 key购买 nike

据我了解,保存到没有硬性限制

chrome.storage.local

只要设置了无限存储权限。这是真的?允许恶意开发人员仅通过请求一个无辜的声音许可就可以淹没某人的硬盘,这不会危及沙箱吗?

最佳答案

默认情况下,在 Chrome 中限制为 5 MB,但确实可以通过 unlimitedStorage 权限禁用该限制。

引用documentation of chrome.storage.local :

QUOTA_BYTES

5242880

The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError.

WebExtension API 与 unlimitedStorage 的结合允许填满磁盘是正确的。这就是为什么建议只安装受信任的扩展。然而对于恶意扩展,我会更关心它们可以发送的数据(例如窃取凭据)。或者他们可以将用户重定向到钓鱼网站。就像恶意软件一样,它能够填满磁盘,但通常会选择其他更有害的攻击。<​​/p>

关于javascript - chrome.storage.local 的数据限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39440876/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com