Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Prevent js errors due to browser storage setItem / removeItem when browser in privacy mode #31
So the interesting thing is that window.localStorage exists in privacy mode, and you actually have to attempt to call setItem to find out if you can store data. getItem works fine, but will always return null in privacy mode.
There really is no good way to go about detection beyond trying to call the action methods on localStorage.