chrome.local.storage 保存目录信息并检索此信息

chrome.local.storage save directory info and retrieve this information

是否可以使用 chrome.local.storage 保存目录中的信息并随后检索此信息以显示其中包含的文件。

提前致谢!

因为你的问题有 google-chrome-app 标签,我假设你问的是 Chrome 应用程序而不是 Chrome 扩展,所以这是我的答案:

Chrome 应用没有 chrome.local.storage API。有一个 chrome.storage API,但是你不能对目录或文件做任何事情,因为存储模型是键值对。

没错,这些键值对在一个(或多个)文件中有物理表示,但它们对应用程序是隐藏的,即使是人类也很难找到。

您可以使用 chrome.fileSystem API 访问实际文件和目录,这完全不同。