Call window.localStorage moved into try catch due to possibly exception in Edge.

This commit is contained in:
Jan Nohavica
2017-01-25 23:03:01 +01:00
parent 837ca51b6f
commit 163e48088a
+1 -1
View File
@@ -28,9 +28,9 @@ function LocalStorageManager() {
LocalStorageManager.prototype.localStorageSupported = function () { LocalStorageManager.prototype.localStorageSupported = function () {
var testKey = "test"; var testKey = "test";
var storage = window.localStorage;
try { try {
var storage = window.localStorage;
storage.setItem(testKey, "1"); storage.setItem(testKey, "1");
storage.removeItem(testKey); storage.removeItem(testKey);
return true; return true;