-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
Documentation: Service Worker on the browsers that do not support it #21304
Comments
@chembu and @jenniferfell fyi ^^ |
The Angular SW only works in browsers which support service workers. This includes all of the application integration (e.g. the If SWs are unsupported in the current browser.
|
Thanks for clarifying! |
Great input from alxhub. The question still remains of how to can configure our PWA app to totally ignore the Service Worker caching on the older browsers such as IE11, but load SW on the newer ones? The intent is for the PWA application to keep functioning as normal in IE. Is there a way to do this in our code? |
As @alxhub mentioned above, you shouldn't need to do anything special in your code. |
Reopening until the original request is resolved:
Also, it sounds like we need to mention this: If the app is implemented to use service workers, but the user is accessing the app via a browser that does not support service workers, then the browser simply ignores the service worker caching. Browsers that support service workers still load the service worker as expected. |
Further comments about possible solution text are on the PR #22546 |
Actually I am observing a slightly opposite thing in my sentry The error is thrown.
I'm not sure how it affects the workflow, but seeing this error in error log is really annoying as long as I can't really fix it. I did not have priorities to report this but as long as you reopen the issue :) |
This happens in main.js, so I assume it happens when one subscribes to SwUpdate this.auth.accessToken.subscribe(val => this.authenticated = !!val);
// https://github.com/angular/angular/issues/20970
if (environment.production) {
this.ngZone.runOutsideAngular(() => interval(6 * 60 * 60).subscribe(() => this.ngZone.run(() => this.swupdate.checkForUpdate())));
}
this.swupdate.available.subscribe(() => this.showUpdatePopup()); |
This error means that the
If you want to avoid that, you can also check whether SW is enabled, via |
Resolved by addition of section to SW intro: https://angular.io/guide/service-worker-intro#browser-support |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
I'm submitting a...
Current behavior
Originated at https://stackoverflow.com/questions/48045748/angular-service-worker-on-the-browsers-that-do-not-support-it . The text is partly copied
Can I Use shows quite a poor support of the feature in relatively important browsers. I can survive the not working IE11, but Safari (especially mobile) is a thing I wouldn't like to keep unsupported.
So, my intention would be to know how the angular service worker module, services, events those services provide etc will behave on the browser that does not support service workers.
Will all those just silently fail? Will the events be triggered anyhow? Will the ngsw-worker.js be requested? Will something be cached in IndexedDB instead of service worker?
The solution looks cool, however I cannot answer the question should I use it? until I know the answers on the questions above.
Expected behavior
The documentation should clearly define what is going on when the Service Worker is not supported by the browser.
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
E.g. I want to implement the auto-refresh when the new app version is deployed => I need an answer to the question whether the service worker manifest will be downloaded on all the browsers and the updates will be pushed by
SwUpdate
or I need to implement it twice. This is actually pushing me in the direction of Service Worker in case it does and pushes away if it does not.Environment
The text was updated successfully, but these errors were encountered: