Check if localStorage is available
问题 I know there has been many questions about checking for localStorage but what if someone manually shuts it off in their browser? Here's the code I'm using to check: localStorage.setItem('mod', 'mod'); if (localStorage.getItem('mod') != null){ alert ('yes'); localStorage.removeItem('mod'); } else { alert ('no'); } Simple function and it works. But if I go into my Chrome settings and choose the option "Don't Save Data" (I don't remember exactly what it's called), when I try to run this function