Recently when I tried to debug in safari incognito mode, an error always occurs:
[Error] QuotaExceededError (DOM Exception 22): The quota has been exceeded.
The root cause is that: storage api, like localStorage
/ sessionStorage
is not supported in safari incognito mode.
According to the MDN wiki, the localStorage is set as an object with a quota of zero, which will make it unusable.
A way is required to detect whether the storage api is available under current browser session.
1 | function storageAvailable(type) { |