Description
There are cases when one product needs to access local data of another product, specifically the localStorage the host keeps for that product. For example, Jollity stores the unwrapped status of collectibles and the user's selected collections locally. Scarcity works with the same collectibles and needs to see the same state. Currently, every product's storage is sealed to that product alone. For Jollity and Scarcity, this means an item unwrapped in one still shows as wrapped in the other.
Motivation
The host-provided localStorage is per product and per device. When two products work on the same items, each keeps its own copy of state, such as unwrapped status and selected collections. Synchronizing this data is not straightforward. Sharing storage between declared friendly products solves this problem. The scoped grants RFC (#477) defines the permission side: a publisher can pre-approve another product to read its storage. What is missing is the ability itself: a host API call that actually reads it.
Requirements
- A product can read the local storage of a declared friendly product through the host API.
- By default, nothing is shared.
- The product that owns the data declares its friendly products. Friendly products access the storage without any confirmation prompts.
- A product that is not declared friendly can still request access, and then the user confirms or denies it.
- The user can see which products share storage and can revoke it.
- Works regardless of whether the other product is currently open.
- Same behaviour on every host (desktop, mobile, web).
Description
There are cases when one product needs to access local data of another product, specifically the localStorage the host keeps for that product. For example, Jollity stores the unwrapped status of collectibles and the user's selected collections locally. Scarcity works with the same collectibles and needs to see the same state. Currently, every product's storage is sealed to that product alone. For Jollity and Scarcity, this means an item unwrapped in one still shows as wrapped in the other.
Motivation
The host-provided localStorage is per product and per device. When two products work on the same items, each keeps its own copy of state, such as unwrapped status and selected collections. Synchronizing this data is not straightforward. Sharing storage between declared friendly products solves this problem. The scoped grants RFC (#477) defines the permission side: a publisher can pre-approve another product to read its storage. What is missing is the ability itself: a host API call that actually reads it.
Requirements