mdn/content

periodicSync needs "periodic-background-sync" permission

Open

#33,692 opened on May 21, 2024

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Markdown (22,427 forks)batch import
Content:WebAPIhelp wanted

Repository metrics

Stars
 (8,900 stars)
PR merge metrics
 (Avg merge 7d 3h) (147 merged PRs in 30d)

Description

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/PeriodicSyncManager/register

What specific section or headline is this issue about?

Exceptions

What information was incorrect, unhelpful, or incomplete?

In chromium browsers, this feature also requires the "periodic-background-sync" permission, which throws an error if not obtained: "Permission denied. "

This permission is not available through code, and will only be granted if the user installs the website (with PWA enabled) on their computer.

I haven't tested it in other browsers, at least in edge and Chrome.

What did you expect to see?

I would like to add a description of the error to the error list.

Do you have any supporting links, references, or citations?

https://developer.chrome.com/docs/capabilities/periodic-background-sync#try_it

Google has mentioned here that the feature is available only after installing the app.

You can determine if you have permissions using this code: navigator.permissions.query({ name: 'periodic-background-sync' }).

Do you have anything more you want to share?

No response

MDN metadata

Contributor guide