Monday, April 14, 2014

Private browsing will cause QUOTA_EXCEEDED_ERR

If your web site uses local storage, and when user does private browsing your website, it might break. The reason is local storage will not be able to store anything if phone is using private browsing.

Suggest to use Modernizr or below script to do detect. (Try-catch might also work?)

if (!!window.localStorage)
    localStorage.setItem(key, val);

No comments:

Post a Comment