当本地/会话存储已满时会发生什么?

What happens when local / Session Storage is full?

我知道这几乎是不可能的,但我心里有个问题。

如果 angular 网络应用程序中的所有网络存储(本地/会话)已满,网络应用程序的行为会怎样?

它会影响网络应用程序的性能吗?如果是那么它将如何影响?

应用程序在以下浏览器 chrome、firefox 和 Opera 中的反应如何?

我正在阅读一个讨论会话和本地存储的博客,但我没有在那里找到我的答案。 (https://krishankantsinghal.medium.com/local-storage-vs-session-storage-vs-cookie-22655ff75a8)

如果尝试向其中添加内容时存储空间已满,根据 the specification 添加 new/updated 项目的方法必须抛出 QuotaExceededError。因此,如果存储已满,您的 app/page 将正常工作,但如果它尝试添加任何内容,该操作将失败并出现错误。

来自link:

The setItem(key, value) method must first check if a key/value pair with the given key already exists in the list associated with the object.

If it does not, then a new key/value pair must be added to the list, with the given key and with its value set to value.

If the given key does exist in the list, and its value is not equal to value, then it must have its value updated to value. If its previous value is equal to value, then the method must do nothing.

If it couldn't set the new value, the method must throw a QuotaExceededError exception. (Setting could fail if, e.g., the user has disabled storage for the site, or if the quota has been exceeded.)

(我的重点)

有一个特殊的例外:超出配额。 你可以在这里阅读:https://chrisberkhout.com/blog/localstorage-errors/