Window: fence 屬性
Window 介面中的只讀屬性 fence 返回當前文件上下文的 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"],
});
規範
| 規範 |
|---|
| 圍欄框架 # dom-window-fence |
瀏覽器相容性
載入中…
另見
- privacysandbox.google.com 上的Fenced frames
- 隱私沙盒(位於 privacysandbox.google.com)