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.setItem polyfill throws error on keys with spaces #669

Closed
trein-homeroom opened this issue Jun 15, 2020 · 0 comments · Fixed by #1141
Closed

localStorage.setItem polyfill throws error on keys with spaces #669

trein-homeroom opened this issue Jun 15, 2020 · 0 comments · Fixed by #1141
Labels
library Relates to an Origami library

Comments

@trein-homeroom
Copy link

Type: bug

Details

  1. Load the polyfill. I did so by doing a) in chrome, changing my user agent to be IE7, b) I deleted localStorage before the call to load the polyfill (delete window.localStorage)

  2. call localStorage.setItem('something with spaces', true);

Result:
polyfill.min.js?features=localStorage:8 Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': 'userdataf f' is not a valid attribute name.
at https://polyfill.io/v3/polyfill.min.js?features=localStorage:8:213
at Array.forEach ()
at n (https://polyfill.io/v3/polyfill.min.js?features=localStorage:8:184)
at t.setItem (https://polyfill.io/v3/polyfill.min.js?features=localStorage:8:809)
at :1:21
(anonymous) @ polyfill.min.js?features=localStorage:8
n @ polyfill.min.js?features=localStorage:8
setItem @ polyfill.min.js?features=localStorage:8
(anonymous) @ VM717:1

As far as I know its not illegal to pass keys with spaces. I'm not clear on why the polyfill is messing around with using DOM elements as a storage of localStorage.

@JakeChampion JakeChampion transferred this issue from polyfillpolyfill/polyfill-service Jun 16, 2020
@JakeChampion JakeChampion removed this from incoming in Origami ✨ Dec 16, 2020
@github-actions github-actions bot added the library Relates to an Origami library label Dec 9, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
library Relates to an Origami library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant