Skip to content
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

[Bug]: Uncaught DOMException: Background Sync is disabled. #39893

Closed
3 tasks done
abdallahemad94 opened this issue Sep 18, 2023 · 1 comment
Closed
3 tasks done

[Bug]: Uncaught DOMException: Background Sync is disabled. #39893

abdallahemad94 opened this issue Sep 18, 2023 · 1 comment
Labels

Comments

@abdallahemad94
Copy link

Preflight Checklist

Electron Version

26.2.1

What operating system are you using?

Windows

Operating System Version

Windows 10

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

Electron has background sync disabled. Background sync is used to trigger the service worker to sync changes. It helps to sync work which was done by user when he was offline. Would be good to enable it by default. It is enabled by default in chromium and chrome.
On page with service worker registered, this snippet should produce no errors.

navigator.serviceWorker.ready.then(function(swRegistration) {
  return swRegistration.sync.register('myFirstSync');
});

This issue was raised at #9802
It is unclear to me why #9802 was merged with #6697. The other issue is about Web Push, which is distinct from Background Sync.
Also, the #6697 was closed without a fix to the Background Sync problem #9802 .

Actual Behavior

When run with electron, I get

Uncaught (in promise) DOMException: Background Sync is disabled.

Testcase Gist URL

No response

Additional Information

How to reproduce
Open youtube.com with electron

OR

git clone https://github.com/hokein/electron-sample-apps
cd electron-sample-apps
npm install -g electron
electron service-worker/mock-response
Open the console and type in the snippet:

navigator.serviceWorker.ready.then(function(swRegistration) {
return swRegistration.sync.register('myFirstSync');
});
It gives the error in electron. Use the same snippet in youtube on the browser, it runs fine.

This is the same bug as #31063 which is closed as not planned the issue still exists with electron v 26.2.1

@MarshallOfSound
Copy link
Member

#6697 is the correct tracking issue for this, internally they are not so distinct and the work required to support one is similar to the other (somehow exposing the ability for electron apps to provide their own service urls for push/sync)

@MarshallOfSound MarshallOfSound closed this as not planned Won't fix, can't repro, duplicate, stale Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants