arielsalminen / feature.js

Feature.js is a fast, simple and lightweight browser feature detection library in 1kb.

Home Page:https://featurejs.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Localstorage test might remove existing content

fvsch opened this issue · comments

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().

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