Skip to content

Fallback localstorage cases

Luke "Jared" Bennett requested to merge fallback-localstorage-cases into master

What does this MR do?

Avoid exceptions from localStorage being accessed when it is disabled by the browser.

  • Active tab memoizer will now simply not work for users with localstorage disabled.

  • Emoji support map and user agent will now not be cached for users with localstorage disabled. This could have a significant perf impact, I haven't checked just yet, will update soon.

  • Filtered search recent searches will now always be empty with a message to the user explaining why they will never have any recent searches.

The other case that uses localStorage is our autosave feature, but its already avoiding exceptions.

This also makes sure localStorage access is checked safely (in a trycatch block)

Are there points in the code the reviewer needs to double check?

Why was this MR needed?

Screenshots (if relevant)

Active tab memoizer

I start on 1 tab, select another, and then refresh

w/ localStorage

2017-04-26_14.33.47

w/o localStorage

2017-04-26_14.33.31

A bit hard to see, but you'll see w/o localstorage, it returns to the default tab after refresh, but w/ localstorage it selected the previously active tab

Recent searches

Screen_Shot_2017-04-26_at_15.14.08

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #30179 (closed).

Closes #25788 (closed).

Merge request reports

Loading