I2I: Expand LocalStorage Usage when Storage API is not used #30872
Labels
INTENT TO IMPLEMENT
Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code
Stale
Inactive for one year or more
Summary
Today AMP restricts localStorage usage to limited cases. The reason is that such stored value needs to be passed to AMP Viewer to be stored.
The proposal is to expand the localStorage usage to all AMP components when the Storage is not applied.
Design document
Expand the existing
storageForDoc()
service to provide a local version, where value will be stored to the document's domain.The exception is that: When the doc is served in an iframe => LocalStorage will behave like sessionStorage
AMP expects developers to understand the tradeoff here
Motivation
While AMP can't expand the Storage API usage for privacy and technical challenge. Developers should be given access to the LocalStorage to improve performance.
Additional context
Such exception has been applied to
<amp-consent>
already to stored consent string.Other requests
#30193 (comment)
/cc @ampproject/wg-approvers
The text was updated successfully, but these errors were encountered: