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

fix: don't use localStorage when browser blocks access #287

Merged

Conversation

marcosvega91
Copy link
Member

@marcosvega91 marcosvega91 commented Oct 30, 2020

fix #284

What:

Fix an issue when the user has disabled the use of cookies

Why:

It was an issue

How:

Before using localStorage I have check that cookies are enabled.
If cookies are disabled user settings will be reset on page refresh.

I have also added a warning on the settings

image

Checklist:

  • Tests
  • Ready to be merged

@smeijer
Copy link
Member

smeijer commented Oct 30, 2020

Thanks! The issue also mentions:

and display an error message informing the user to enable third-party cookies if required

I think it would indeed be nice to show a message in the settings dialog if localStorage is disabled. Otherwise the user might not understand why their test-id attribute isn't saved.

@marcosvega91
Copy link
Member Author

I have added this warning

image

@smeijer smeijer changed the title fix: check if cookie are enabled before using localStorage fix: don't use localStorage when browser blocks access Oct 30, 2020
@smeijer smeijer merged commit d5e3d81 into testing-library:develop Oct 30, 2020
@smeijer
Copy link
Member

smeijer commented Oct 30, 2020

Thanks, Marco!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Chrome extension doesn't work when third-party cookies are blocked
2 participants