Last active
March 29, 2017 15:07
-
-
Save mflisikowski/91205253ca90d7d9fa4e496a6ab66ab3 to your computer and use it in GitHub Desktop.
isLocalStorageNameSupported
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
function isLocalStorageNameSupported() | |
{ | |
var testKey = 'test', storage = window.sessionStorage; | |
try | |
{ | |
storage.setItem(testKey, '1'); | |
storage.removeItem(testKey); | |
return localStorageName in win && win[localStorageName]; | |
} | |
catch (error) | |
{ | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment