https://github.com/acanguven/storageservice
📦 Provides localStorage and sessionStorage features for unsupported devices and private mode browsing of Safari
https://github.com/acanguven/storageservice
localstorage sessionstorage
Last synced: about 2 months ago
JSON representation
📦 Provides localStorage and sessionStorage features for unsupported devices and private mode browsing of Safari
- Host: GitHub
- URL: https://github.com/acanguven/storageservice
- Owner: Acanguven
- License: mit
- Created: 2017-11-14T06:50:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-10-10T05:34:06.000Z (over 6 years ago)
- Last Synced: 2025-03-29T15:11:24.124Z (3 months ago)
- Topics: localstorage, sessionstorage
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# StorageService
📦 Provides `localStorage` and `sessionStorage` features for unsupported devices and private mode browsing of Safari.### Browser Support
- IE5+
- Chrome all versions
- Mozilla all versions
- Yandex all versionsIf storage type is not supported or disabled(Safari private browsing) creates in memory store for `sessionStorage` and cookie store for `localStorage`.
If you want to use in memory storage just change the line to.
```javascript
this.sessionStorage = this.isSupported('sessionStorage') ? window.sessionStorage : new MemoryStore();
```
## LocalStorage
- `window.StorageService.localStorage.getItem(name);`
- `window.StorageService.localStorage.setItem(name, value);`
- `window.StorageService.localStorage.removeItem(name);`## SessionStorage
- `window.StorageService.sessionStorage.getItem(name);`
- `window.StorageService.sessionStorage.setItem(name, value);`
- `window.StorageService.sessionStorage.removeItem(name);`