【发布时间】:2017-07-17 00:18:59
【问题描述】:
当我处于隐身模式时,我在 Safari 上收到 QuotaExceededError (DOM Exception 22): The quota has been exceeded.。
但他们谈论的是 setItem,我在其他地方得到了这个错误。
我在此行收到此错误:localStorage['gallery.extensions'] = JSON.stringify({}); 或 localStorage['asdf'] = 'asdfg';
我尝试将this answer 组合起来,并将localStorage['asdf'] = 'asdfg'; 之类的每一行替换为localStorage.setItem('asdf', 'asdfg'),并将localStorage['asdf'] 之类的每个访问替换为localStorage.getItem('asdf'),但这也无济于事。
【问题讨论】:
-
I get this error on this line- 这就像使用setItem- 所以同样的约束 -
您链接到stackoverflow.com/questions/21159301/… 的问题中接受的答案适用于您的情况
-
我从这里添加了代码:stackoverflow.com/a/27081419/4279201,但它仍然在该行抛出了这个错误。
-
但我需要在隐身模式下测试我的应用程序,因为我不想每次更改某些内容时都去清理我的数据。 @JaromandaX
标签: javascript safari incognito-mode