任何用于模拟低存储(超出配额)的浏览器开发工具

Any browser dev tools to simulate low storage (quota exceeded)

我使用 localStorage 并且需要知道当用户设备上没有剩余存储空间(或者至少浏览器拒绝访问存储空间)时我的网站的行为 超过配额)。

是否有任何开发工具或任何其他方式(除了用文件填充我的设备)来模拟“配额超出错误”?这似乎是很多用户无法访问我的网站的原因。

一些浏览器允许用户输入本地存储限制。尝试设置一个非常低的限制。

  • Opera:opera:config -> localStorage 的域配额
  • Firefox:about:config -> dom.storage.default_quota

this

另一种方法可能是在您的应用程序启动之前“填满”本地存储,以模拟完整存储。

在 chrome 的较新版本中:

"You can now override storage quota size in the Storage pane. This feature gives you the ability to simulate different devices and test the behavior of your apps in low disk availability scenarios."

"Go to Application > Storage, enable the Simulate custom storage quota checkbox, and enter any valid number to simulate the storage quota."

如所见here