Created
November 14, 2018 20:54
-
-
Save juanbrujo/424c359dd3365a04664ad5cfc42d5878 to your computer and use it in GitHub Desktop.
Check if browser has webstorage enabled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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