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)} 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
  • 2022-12-23
  • 2021-06-05
  • 2022-12-23
  • 2022-12-23
  • 2022-02-18
猜你喜欢
  • 2021-09-19
  • 2021-04-06
  • 2021-06-25
  • 2022-12-23
  • 2021-07-01
  • 2022-02-21
相关资源
相似解决方案