Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect if access to localStorage is forbidden by the user's browser #55080

Merged
merged 3 commits into from
Oct 18, 2018

Commits on Oct 15, 2018

  1. Detect if access to localStorage is forbidden by the user's browser

    If the user's cookie/persistent storage setting forbid access to localStorage,
    catch the exception and abort the access.
    
    Currently, attempting to use the expand/contract links at the top of the page
    for structs/consts/etc. fails due to an unhandled error while accessing
    localStorage, if such access is forbidden, as the exception from the failed
    access propagates all the way out, interrupting the expand/contract. Instead, I
    would like to degrade gracefully; the access won't happen (the collapse/expand
    state won't get persisted) but the actual expanding/contracting of the item
    will go on to succeed.
    
    Fixes rust-lang#55079
    thanatos committed Oct 15, 2018
    Configuration menu
    Copy the full SHA
    d4e2dca View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2018

  1. Extract localStorage tests out into a helper method; use in getCurren…

    …tValue()
    
    1. Extract the tests for whether or not we have workable localStorage out into
       a helper method, so it can be more easily reused
    2. Use it in getCurrentValue() too, for the same reasons, as suggested in code
       review
    thanatos committed Oct 16, 2018
    Configuration menu
    Copy the full SHA
    8362aa2 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2018

  1. Configuration menu
    Copy the full SHA
    cbe98ec View commit details
    Browse the repository at this point in the history