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

Third-Party Service Worker Registration and Brave #14

Closed
jonathansampson opened this issue May 20, 2021 · 2 comments
Closed

Third-Party Service Worker Registration and Brave #14

jonathansampson opened this issue May 20, 2021 · 2 comments
Labels
enhancement New feature or request tracked

Comments

@jonathansampson
Copy link

Describe the bug
For a user running Brave under normal settings, the service worker registration for stackblitz.io fails, as it is a third party domain. This failure prevents the localhost server from being stood up for the user's blitz. To remedy the issue, a user can modify their shields (via the lion icon to the right of the address bar) in Brave to permit third-party cookies (this setting also controls third-party service workers).

Link to the blitz that caused the error

To Reproduce
Steps to reproduce the behavior:

  1. In Brave, visit https://stackblitz.com/edit/web-platform-kaxdum

Expected behavior

The "localhost" connection is established, and the content is shown.

Screenshots

service-workers-registration

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Brave
  • Version: 1.24.85

Additional context

If you catch the registration failure, you can inform the user that their security settings may have prevented the feature from working. For Brave users (there are over 30 million monthly active users at the time of this writing), you can can inform them that relaxing the shield settings for cookies (and other third-party storage) will resolve the issue. This is what I did in the GIF above. Brave can be detected via its navigator.brave.isBrave function (which returns a promise).

@SamVerschueren
Copy link
Contributor

Thanks for reporting this. It's a very good point and we should definitely work on improving the experience for Brave users. I'm looping it back to the team.

@fvsch
Copy link

fvsch commented Sep 10, 2021

@jonathansampson We now have a warning component shown in Brave when the Service Worker registration fails, linking to https://github.com/stackblitz/webcontainer-core/blob/main/browsers/brave/brave.md

It actually shipped in July, but I forgot to update this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tracked
Projects
None yet
Development

No branches or pull requests

4 participants