このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

Window: fence プロパティ

Deprecated
To be removed

This feature is pending removal from browsers. Using it now may lead to broken functionality in future updates. Following the announcement that Chrome will maintain its current approach to third-party cookies, Chrome decided to withdraw certain Privacy Sandbox features including the <fencedframe> element and related APIs.

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

fence は、Window インターフェイスの読み取り専用のプロパティであり、現在の文書コンテキストに対応する Fence オブジェクトインスタンスを返します。

Fence オブジェクトは、<fencedframe>FencedFrameConfig 経由で読み込まれたもの)または<iframe>(不透明な URN 経由で読み込まれたもの)内に埋め込まれた文書でのみ利用できます。

メモ: FencedFrameConfig と不透明な URN に関する説明については、 <fencedframe> の仕組みを参照してください。

Fence オブジェクトのインスタンス、またはこの文書コンテキストが Fence オブジェクトにアクセスできない場合は null です。

js
window.fence.reportEvent({
  eventType: "click",
  eventData: JSON.stringify({ clickX: "123", clickY: "456" }),
  destination: ["buyer", "seller"],
});

仕様書

仕様書
Fenced Frame
# dom-window-fence

ブラウザーの互換性

関連情報