-
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
Background-sync fallback not working in Chrome when Background Sync API is disabled #2393
Comments
Facing the same issue except with Electron rather than Android WebView. Any updates on this ? |
Seems that simply checking for the presence of the /**
* In sync-supporting browsers, this adds a listener for the sync event.
* In non-sync-supporting browsers, this will retry the queue on service
* worker startup.
*
* @private
*/
private _addSyncListener() {
if ('sync' in self.registration) {
self.addEventListener('sync', (event: SyncEvent) => {
// ... |
Apologies that there's hasn't been any activity on this since it was first reported. I'm going to explore a few possible workarounds, including the feasibility of attempting a no-op sync registration wrapped in a |
Hey All—Sorry again for the lack of progress. I've been looking into this again, and I'm struggling with a "clean" solution here that detects the failure at runtime. What I'm thinking instead is just to ship a new option in It would not address the situation with the old Android WebView user agents mentioned above, however. Does this sound like it would be useful enough to unblock at least the Electron developers? |
+1 for the update for Electron |
This is now available as an opt-in in https://github.com/GoogleChrome/workbox/releases/tag/v6.5.0 |
Library Affected:
workbox-background-sync
Browser & Platform:
Android WebView (Chrome Stable)
Issue or Feature Request Description:
The sw doesn't detect that the browser (Chrome) doesn't support (or has disabled) the Background Sync API, which results in both the BGS API and the fallback to not work.
The requests are added to the queue correctly (in IndexedDB) but the queue is never accessed/cleared.
Error:
Unable to register sync event for 'myQueueName'. DOMException: Background Sync is disabled.
Details:
Workbox v5.0.0
sw code is here, a basic example of the BGS package
Working on Chrome v80 (Windows 10 x64, and Android 10), using the BGS API
Working on Firefox v68.5.0 (Android 10) and Firefox v73.0.1 (Windows 10 x64), using the fallback (Firefox doesn't support the BGS API)
Not Working on Android WebView (Android 7, webview implementation: Chrome Stable, installed Chrome v80)
@philipwalton Here it is. Feel free to ask for more details and/or if you need me to debug further.
The text was updated successfully, but these errors were encountered: