arielsalminen / feature.js

Feature.js is a fast, simple and lightweight browser feature detection library in 1kb.
https://featurejs.com/
3.17k stars 115 forks source link

Localstorage test might remove existing content #25

Closed fvsch closed 5 years ago

fvsch commented 8 years ago

The key used for the localStorage test is "x", and the test removes it from localStorage.

If a site or application already uses this key (which is not that unlikely, e.g. if a not very clever script uses "x" and "y" without any prefix to store some coordinates), the site/app's data will be deleted.

I suggest using var test = "featurejs-test"; or something shorter but less likely to create conflicts. One short option is to use var test = Date().

meowsus commented 5 years ago

This is a great idea, and good catch! Thanks @fvsch!