question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Background-sync fallback not working in Chrome when Background Sync API is disabled

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jeffposnickcommented, Feb 3, 2021

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 try/catch in addition to the 'sync' in self.registration check.

0reactions
jeffposnickcommented, Feb 23, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

How can I detect if client has Background Sync support from ...
I know Workbox has a Background Sync "fallback" for browsers that don't support Background Sync, but this not working very well, so I...
Read more >
Android WebView BackgroundSync is Disabled, How to ...
It's disabled because it's not implemented for webview; there's no way to enable it. Things like background sync, notifications, etc are more complex...
Read more >
workbox-background-sync - Chrome Developers
The new BackgroundSync API is an ideal solution to this problem. When a service worker detects that a network request has failed, ...
Read more >
Background Sync with Service Workers - David Walsh Blog
Background sync with service workers allow developers to store information while offline to sync when connected.
Read more >
Background Sync API | Can I use... Support tables for HTML5 ...
Background Sync API. - UNOFF. Provides one-off and periodic synchronization for Service Workers with an onsync event. Usage % of.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found