Back to Content

Permissions-Policy: web-share directive

files/en-us/web/http/reference/headers/permissions-policy/web-share/index.md

latest1.2 KB
Original Source

{{SeeCompatTable}}

The HTTP {{HTTPHeader('Permissions-Policy')}} header web-share directive controls whether the current document is allowed to use the {{domxref("Navigator.share","Navigator.share()")}} method of the Web Share API to share text, links, images, and other content to arbitrary destinations of the user's choice.

Specifically, where a defined policy blocks usage of this feature, {{domxref("Navigator.share()")}} calls will return a {{jsxref("Promise")}} that rejects with a {{domxref("DOMException")}} of type NotAllowedError.

Syntax

http
Permissions-Policy: web-share=<allowlist>;
  • <allowlist>

Default policy

The default allowlist for web-share is self.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

<!-- Browser implementation is being discussed in <https://github.com/w3c/web-share/issues/169>. -->

See also