【bug】QUOTA_EXCEEDED_ERR: DOM Exception 22


iOS的Safari在無痕模式下,sessionStorage操作產生異常,報錯QUOTA_EXCEEDED_ERR: DOM Exception 22。

html5 localStorage error with Safari: “QUOTA_EXCEEDED_ERR: DOM Exception 22: An attempt was made to add something to storage that exceeded the quota.”

function isLocalStorageNameSupported() {
  var testKey = 'test', storage = window.sessionStorage;
  try {
    storage.setItem(testKey, '1');
    storage.removeItem(testKey);
    return true;
  } catch (error) {
    return false;
  }
}

調試

try {} catch(error) {alert(error)} 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM