Permissions-Policy: bluetooth

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。

HTTP の Permissions-Policy ヘッダーにおける bluetooth ディレクティブは、現在の文書で Web Bluetooth API の使用を許可するかどうかを制御します。

仕様上、ポリシーによってこの機能の使用がブロックされていた場合、 Navigator.bluetooth から返される Bluetooth オブジェクトのメソッドのアクセスをブロックします。

構文

http
Permissions-Policy: bluetooth=;

この機能を許可するオリジンのリストです。 Permissions-Policy > 構文を参照してください。

既定のポリシー

bluetooth の既定の許可リストは self です。

全般的な例

SecureCorp Inc. は、 Web Bluetooth API を、自社のオリジンおよびオリジンが https://example.com であるものを除く、すべての閲覧コンテキストで無効にしたいと考えているとします。 これは、次の HTTP レスポンスヘッダーを送信して、権限ポリシーを定義することで実現できます。

http
Permissions-Policy: bluetooth=(self "https://example.com")