-
Notifications
You must be signed in to change notification settings - Fork 822
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
Rename the google analytics script to avoid errors due to ad/content blockers #1646
Comments
Alternative approach (and just throwing it out there), we could not throw on a bad import: https://github.com/GoogleChrome/workbox/blob/master/packages/workbox-sw/controllers/WorkboxSW.mjs#L144 Then allow developers to check if
Not sure if there is a good idea, but would allow developers to handle a situation like this. |
FWIW, we’re hitting this on v8.dev: v8/v8.dev#32 |
@mathiasbynens sorry, as @jeffposnick mentioned in that thread, you can use the v4 alpha. We're calling it an alpha because we expect the API to change a bit more, not because we think it's unstable. @gauntface I think that's a cleaner option, but it requires people to know about the problem. I suspect the majority of developers using |
@philipwalton agree - I was just putting it out there. |
For anyone struggling with this issue, wrap the
This way adblock doesn't break whole service-worker. |
@wodCZ, yep, that works, but hopefully in v4 developers won't even have to worry about it. Another options (since we're listing options), is to bundle the SW yourself via rollup, webpack, or something similar. That way you don't use We're hoping to publish more guides on how to do this in the near future, but if you're interested in doing it now you can look at the SW source code used on my blog as an example. |
Forking the discussion from #1186.
We should consider renaming the built
workbox-google-analytics
script because apparently some ad/content blockers will block it, which results in an error, and thus the entire service worker install fails.(Note, this will probably require a breaking change.)
/cc @dumbmatter
The text was updated successfully, but these errors were encountered: