QuotaExceededError: Dom exception 22: An attempt was made to add something to storage that exceeded the quota

后端 未结 9 1624
夕颜
夕颜 2020-12-04 05:42

Using LocalStorage on iPhone with iOS 7 throws this error. I\'ve been looking around for a resolvant, but considering I\'m not even browsing in private, nothing is relevant.

9条回答
  •  囚心锁ツ
    2020-12-04 06:10

    I happened to run with the same issue in iOS 7 (with some devices no simulators).

    Looks like Safari in iOS 7 has a lower storage quota, which apparently is reached by having a long history log.

    I guess the best practice will be to catch the exception.

    The Modernizr project has an easy patch, you should try something similar: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/storage/localstorage.js

提交回复
热议问题