mdn/content

periodicSync needs "periodic-background-sync" permission

Open

#33 692 ouverte le 21 mai 2024

Voir sur GitHub
 (0 commentaires) (0 réactions) (0 assignés)Markdown (22 427 forks)batch import
Content:WebAPIhelp wanted

Métriques du dépôt

Stars
 (8 900 stars)
Métriques de merge PR
 (Merge moyen 7j 3h) (147 PRs mergées en 30 j)

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

Guide contributeur