function isLocalStorageAvailable() {
	if(typeof localStorage === "object") {
		try {
			localStorage.setItem("smde_localStorage", 1);
			localStorage.removeItem("smde_localStorage");
		} catch(e) {
			return false;
		}
	} else {
		return false;
	}

	return true;
}
function isLocalStorageAvailable() {
	if(typeof localStorage === "object") {
		try {
			localStorage.setItem("smde_localStorage", 1);
			localStorage.removeItem("smde_localStorage");
		} catch(e) {
			return false;
		}
	} else {
		return false;
	}

	return true;
}
function isLocalStorageAvailable ( ) { if ( typeof localStorage === "object" ) { try { localStorage . setItem ( "smde_localStorage" , 1 ) ; localStorage . removeItem ( "smde_localStorage" ) ; } catch ( e ) { return false ; } } else { return false ; } return true ; }
Safari, in Private Browsing Mode, looks like it supports localStorage but all calls to setItem throw QuotaExceededError. We're going to detect this and set a variable accordingly.
Safari in Private Browsing Mode looks like it supports localStorage but all calls to setItem throw QuotaExceededError . We re going to detect this and set a variable accordingly .
Check if local storage is available