Shared Storage API
The keys() method of the
WorkletSharedStorage interface returns an async iterator, which contains the keys for each item in a WorkletSharedStorage instance.
Syntax
keys()
Parameters
None.
Return value
An array of the WorkletSharedStorage's enumerable property keys.
Exceptions
- TypeError
- : Thrown if the calling site does not have the Shared Storage API included in a successful privacy sandbox enrollment process.
Examples
// keys() available inside a shared storage worklet module
const storage = await this.sharedStorage;
async function logKeys() {
for await (const key of storage.keys()) {
console.log(key);
}
}
Specifications
Browser compatibility
See also
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
