4 ms·
localStorage can be cleared at any time anyway. This simply makes it happen on each page navigation. IDK what you'd rather do in Chrome Incognito, Safari Priva
by paulddraper 10y ago
localStorage can be cleared at any time anyway. This simply makes it happen on each page navigation.
IDK what you'd rather do in Chrome Incognito, Safari Private, Edge InPrivate, etc.
---
PS. If the OS registry entry for localStorage location is invalid or missing, IE will also throw an error.
- lucideer 10y agoWhat I would do in Incognito, etc. would depend on the website/app and use-case. The point was that handling that on a case by case basis makes more sense than the suggested silent (and I would say unexpected) behavioural change.
- AshleysBrain 10y agoI'd say that if the user is using a private browsing mode, they are explicitly indicating to the browser not to store anything, and they will know that will happen. It's the whole purpose of the feature, so I don't think it counts as "silently" doing anything. I don't think there's any reason to then potentially break web pages that (quite reasonably) expect storage APIs to work.
- paulddraper 10y agoRight. It's like "silently" removing session and non-session cookies when the windows closes. That's the whole point.