Storing preferences in localStorage by suggestions of @mathiasbynens