Update for using localStorage when available.