3 ms·
Any site that is broken by Private Browsing causing storage quota exceptions in localStorage is going to be broken by quota exceptions under "normal" operation.
by madeofpalk 8y ago
Any site that is broken by Private Browsing causing storage quota exceptions in localStorage is going to be broken by quota exceptions under "normal" operation.
It's in the spec, maybe developers should make their websites a bit more resilient to the very real errors that can happen? Did they just forget about error handling?
- rasz 8y agospec? localstorage errors are not standardized, every browser gives quota exceeded error different name and number, you have to use something like '' e.name.toLowerCase().includes("quota")
- madeofpalk 8y agoBut localStorage.setItem() throwing an error definitely is in the spec, so if someone isn't handling Safari's localStorage behaviour in Private Browsing Mode (that is, throwing exceptions) then they aren't handling the parts of the spec.
- strictnein 8y agoThe web isn't built on specs, it's built on conventions. Safari breaks the convention.
- madeofpalk 8y agothe convention is that localStorage throws exceptions. it does in every browser. if a site breaks because it doesn't do error handling, then that's the site's problem.
- xmodem 8y agoYou and many of the commenters miss an important point: Any apparent behaviour difference between private and non-private mode should be considered a bug, because sites can and do abuse it to detect private mode.
- madeofpalk 8y agoI disagree. You might be able to use it to _guess_ but all browsers can throw a quota exceeded exception under normal behaviour. I see this every now and then on mobile devices where the phone is so full the browser refuses to store more localStorage items.
- xmodem 8y agoThis is exactly what I want to prevent though - I want to prevent dodgy sites from using the quota exceeded exceptions from localStorage to (100% accurately in my experience) guess that I'm browsing in private mode.