Skip to content

Instantly share code, notes, and snippets.

@juanbrujo
Created November 14, 2018 20:54
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 juanbrujo/424c359dd3365a04664ad5cfc42d5878 to your computer and use it in GitHub Desktop.
Save juanbrujo/424c359dd3365a04664ad5cfc42d5878 to your computer and use it in GitHub Desktop.
Check if browser has webstorage enabled
// check if browser has webstorage enabled
function hasStorage () {
try {
localStorage.setItem('has', 'has')
localStorage.removeItem('has')
return true
} catch (exception) {
return false
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment