gpt4 book ai didi

javascript - 了解未登录 Chrome 浏览器时 chrome.storage.sync 的行为

转载 作者:行者123 更新时间:2023-11-30 11:53:15 25 4
gpt4 key购买 nike

我一直在研究 chrome.storage.sync API 作为我正在构建的 Google Chrome 扩展程序的一部分。

API 清楚地表明,如果您使用 Google 帐户登录 Chrome 浏览器并使用 chrome.storage.sync.set,那么下次您可以访问设置的所有数据使用同一 Google 帐户登录 Chrome 浏览器并使用 chrome.storage.sync.get

API 没有特别清楚的是 chrome.storage.sync 在未登录 Chrome 浏览器时的行为。

从我的实验来看,当登录到 Chrome 浏览器时,chrome.storage.sync.setchrome.storage.local。设置保存到不同的地方。

API 中说:

When Chrome is offline, Chrome stores the data locally. The next time the browser is online, Chrome syncs the data. Even if a user disables syncing, storage.sync will still work. In this case, it will behave identically to storage.local.

看来是那个地方

Chrome stores the [synced] data locally

chrome.storage.local.set 存储它的位置不同。谁能证实这是不是真的?

最佳答案

当 Chrome.storage.sync 无法连接到互联网时,它会将数据存储在本地一个新的临时位置。它不会将其存储在 Chrome.storage.local 中,并且仍然可以通过 Chrome.storage.sync 进行访问。

困惑似乎在于语言。 Chrome.storage.local 是一个单独的位置,而 Chrome.storage.sync 的行为类似于 Chrome.storage.local。它不使用相同的存储位置

关于javascript - 了解未登录 Chrome 浏览器时 chrome.storage.sync 的行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38839959/

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