Hacker News new | past | comments | ask | show | jobs | submit login

I too wish they provided an ephemeral localStorage in private browsing.

But in any case, your application should be interacting with localStorage through an in-memory facade, otherwise it's still going to break with lots of other edge-cases. All operations should be treated as volatile, and probably silently suppressed on failures.

Using a facade also makes testing easier, and if you avoid global side-effects it becomes easier to parallelize test-cases.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact