Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StephanWeinhold/caaa70fa9c003980257b to your computer and use it in GitHub Desktop.
Save StephanWeinhold/caaa70fa9c003980257b to your computer and use it in GitHub Desktop.
Checks if the visitor's browser is supporting local storage.
/**
* return bool
*/
function checkIfLocalStorageIsSupported() {
try {
return 'localStorage' in window && window['localStorage'] !== null;
} catch (e) {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment