HTMLIFrameElement: allow プロパティ

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

allowHTMLIFrameElement インターフェイスのプロパティで、この <iframe> 要素に対して指定された権限ポリシーを示します。このポリシーは、リクエストのオリジンに基づいて、この <iframe> 要素で利用できる機能(例えば、 microphonecamerabatteryweb-share などへのアクセス)を定義します。

allow 属性で指定する権限ポリシーは、Permissions-Policy ヘッダーで指定するポリシーの上位にさらに制限を実装します。 置き換えるものではありません。

詳しくは <iframe> の権限ポリシーの構文を参照してください。

これは <iframe> 要素の allow 属性を反映します。

A string indicates the 権限ポリシー specified for this <iframe> element, each policy must be separated by space.

html
<iframe
  id="el"
  src="https://example.com"
  allow="geolocation 'self' https://a.example.com https://b.example.com; fullscreen 'none'"></iframe>
js
const el = document.getElementById("el");
console.log(el.allow); // Output: "geolocation 'self' https://a.example.com https://b.example.com; fullscreen 'none'"

See Permissions Policy in <iframe> element for more available examples.

仕様書

Specification
HTML
# dom-iframe-allow

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
allow

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

関連情報