Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I2I: Expand LocalStorage Usage when Storage API is not used #30872

Closed
zhouyx opened this issue Oct 26, 2020 · 2 comments
Closed

I2I: Expand LocalStorage Usage when Storage API is not used #30872

zhouyx opened this issue Oct 26, 2020 · 2 comments
Labels
INTENT TO IMPLEMENT Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code Stale Inactive for one year or more

Comments

@zhouyx
Copy link
Contributor

zhouyx commented Oct 26, 2020

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

@zhouyx zhouyx added the INTENT TO IMPLEMENT Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code label Oct 26, 2020
@dvoytenko
Copy link
Contributor

I don't see a reason why we shouldn't allow extensions to use localStorage for more use cases. However, I'd not use storageForDoc service for that and instead allow direct access to the localStorage and sessionStorage.

@stale
Copy link

stale bot commented Apr 24, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Inactive for one year or more label Apr 24, 2022
@stale stale bot closed this as completed May 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
INTENT TO IMPLEMENT Proposes implementation of a significant new feature. https://bit.ly/amp-contribute-code Stale Inactive for one year or more
Projects
None yet
Development

No branches or pull requests

2 participants