You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder if this should also control whether we serve the Offline page and the Server Error page.
This was not implemented in #365 but after thinking about it more, it seems the right way to go. Furthermore, the service worker should only ever be installed if there is any SW logic registered to run in it. So if the offline/error page is included with offline browsing, and offline browsing is not enabled, then there would be no SW logic registered and the SW should be skipped from being installed. As soon as that checkbox is enabled or if a plugin registers a script to run in the service worker, then the SW would then be installed automatically.
There probably needs to be a new conditional function added to check whether the SW is being installed.
By not installing the service worker by default, we'll avoid situations where the SW is responding to requests unexpectedly, which can cause confusion. It will also reduce extraneous SW installation across the web, reducing the service workers that are installed but aren't doing anything much of value.
The text was updated successfully, but these errors were encountered:
Do we provide users an option to allow displaying offline/error pages similar to offline browsing?
This would essentially mean that the current Offline Browsing checkbox in Reading settings would be the opt-in to not only cache page navigations but also enable the offline page.
There probably needs to be a new conditional function added to check whether the SW is being installed.
Basically there would be a helper function to see if there have been any registered SW scripts for a given scope.
What about the default scripts that we are loading in the service worker, In what way should they be taken care of?
We'd ignore the default scripts. So if only the default scripts are present, we'd skip installing the service worker since it wouldn't be doing anything.
Since this is a more substantial change that may have unexpected behavior for users who previously have been passing the PWA check without enabling offline browsing, I'm going to punt this to 0.8 so we can think about it some more.
As mentioned in #344 (comment):
This was not implemented in #365 but after thinking about it more, it seems the right way to go. Furthermore, the service worker should only ever be installed if there is any SW logic registered to run in it. So if the offline/error page is included with offline browsing, and offline browsing is not enabled, then there would be no SW logic registered and the SW should be skipped from being installed. As soon as that checkbox is enabled or if a plugin registers a script to run in the service worker, then the SW would then be installed automatically.
There probably needs to be a new conditional function added to check whether the SW is being installed.
By not installing the service worker by default, we'll avoid situations where the SW is responding to requests unexpectedly, which can cause confusion. It will also reduce extraneous SW installation across the web, reducing the service workers that are installed but aren't doing anything much of value.
The text was updated successfully, but these errors were encountered: