Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deal with Apple iOS Safari private -mode disabling LocalStorage?

There are several discussions on the web about technical details of how iOS 6 introduced a pain in the butt problem for us developer that when Safari's private mode is on, then the browser's LocalStorage is not writable.

But how are you dealing with this in your modern web application? Do you just detect this and notify the user via a modal window notification that your web application is not usable unless the user disables Safari's private mode? Or have you implemented fallback measures that don't use LocalStorage at all? If so, which measures are those?

like image 359
ux.engineer Avatar asked Sep 30 '22 02:09

ux.engineer


1 Answers

Unfortunately, the only away around it is to fail silently (wrap a dummy set/get to localStorage in a try/catch) and gracefully degrade.

There are several other storage techniques you can use to gracefully degrade, e.g., cookies. There are also several libraries which have already solved this. Here's an example reference post for more info: HTML5 Local Storage fallback solutions.

like image 105
joeltine Avatar answered Oct 12 '22 23:10

joeltine