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

localStorage.removeItem creates key with arbitrary value from state #37739

Closed
AntonioGargaro opened this issue Feb 21, 2022 · 1 comment · Fixed by ampproject/worker-dom#1136
Assignees

Comments

@AntonioGargaro
Copy link

Description

Using window.localStorage.removeItem within the amp-script worker using any value (even if it doesn’t exist) actually creates an item in local storage with that key and a value that is defined somewhere in AMP environment.

It can be reproduced by having the removeItem code within the amp-script JS that is guaranteed to be executed. The expected behaviour would be for this value to just be deleted.

cc @samouri

Reproduction Steps

Added an AMP playground link here. On line 27 I added window.localStorage.removeItem and you can see that the helloworld key to be removed is actually created in localstorage.

Relevant Logs

No response

Browser(s) Affected

Chrome, Firefox, Safari

OS(s) Affected

No response

Device(s) Affected

No response

AMP Version Affected

No response

@AntonioGargaro
Copy link
Author

@samouri This appears to be back again, can someone confirm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants