ucla-oarc-mobile / mwf

UCLA Mobile Web Framework
http://mwf.ucla.edu
Other
86 stars 25 forks source link

Customize home page fails when in private browsing mode #150

Closed ghost closed 12 years ago

ghost commented 12 years ago

In Safari private browsing mode, localStorage is supported. But any attempt to set or retrieve localStorage will get an exception. This causes the iOS device to be classified as full device and shows the customize home page link on the front page. But when you do customize the home page, the settings are not saved because localStorage throws an error.

Perhaps the fix is to update capability.js to not only detect the support, but if it is working by setting and removing a temporary variable? This will make the device to be classified as a standard device. Any other suggestions?

The same behavior is happening for sessionStorage.

Trott commented 12 years ago

The localStorage/private browsing mode thing was fixed in Modernizr in October. https://github.com/Modernizr/Modernizr/commit/a93625c21694fcda6fc1514a48f54232f703194a

It looks to me like this fix made it into MWF.

Is your instance using an old Modernizr perhaps?

ghost commented 12 years ago

Hmm... Yes, it's using Modernizr in MWF 1.3, which is 2.5.3 that contains the fix. I think I know what my problem is now. I'm displaying the link if it is full classification. But our full classification test doesn't test for localstorage. So, I'll just have to be smarter in when to display the customize home page link.