[英]On a browser, sessionStorage in Safari's Private Browsing does not work the same as Chrome's Incognito Mode and Firefox's Private Window?
It seems that for sessionStorage
, it works differently on Chrome's Incognito Mode vs Safari's Private Browsing and Firefox's Private Window? 似乎对于
sessionStorage
,它在Chrome的隐身模式与Safari的私人浏览和Firefox的私人窗口之间的工作方式不同? I can find something on http://www.webdirections.org/blog/webstorage-persistent-client-side-data-storage/ but it doesn't say that Safari's Private Browsing will throw an exception. 我可以在http://www.webdirections.org/blog/webstorage-persistent-client-side-data-storage/上找到一些内容,但它没有说Safari的私人浏览会抛出异常。
The following is how I opened "Private Browsing": 以下是我打开“私人浏览”的方式:
and on Safari, sessionStorage
does not work, and if I do the following in the console: 在Safari上,
sessionStorage
不起作用,如果我在控制台中执行以下操作:
> sessionStorage["foo"] = 123.4
Error: QUOTA_EXCEEDED_ERR: DOM Exception 22
> sessionStorage["foo"]
undefined
but on Chrome or Firefox, sessionStorage
works as usual (as non-private browsing). 但在Chrome或Firefox上,
sessionStorage
照常工作(非私人浏览)。 Is the above accurate as far as sessionStorage
is concerned? 就
sessionStorage
而言,上述是否准确?
Your assessment is practically accurate: 您的评估几乎准确:
0
in private mode, so all attempts to set a value will fail. 0
的配额,因此所有设置值的尝试都将失败。 This is kinda OK according to the spec , as the spec does not mandate a minimum space requirement. localStorage
only). localStorage
很重要)。 Please note that other browsers are also free to throw QuotaExceededError
exceptions at any given time, should you go over the quota. 请注意,如果您超过配额,其他浏览器也可以在任何给定时间自由抛出
QuotaExceededError
异常。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.