Movatterモバイル変換


[0]ホーム

URL:


  1. 面向开发者的 Web 技术
  2. Web API
  3. Window
  4. Window:fence 属性

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in EnglishAlways switch to English

Window:fence 属性

Limited availability

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

实验性:这是一项实验性技术
在将其用于生产之前,请仔细检查浏览器兼容性表格

Window 接口的只读属性fence 为当前文档上下文返回一个Fence 对象实例。

Fence 对象仅对嵌入在<fencedframe>(通过FencedFrameConfig 加载)或<iframe>(通过不透明 URN 加载)中的文档可用。

备注:参见<fencedframe> 的工作原理了解有关FencedFrameConfig 和不透明 URN 的一些描述。

一个Fence 对象实例,如果文档上下文无法访问Fence 对象,则为null

示例

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

规范

Specification
Fenced Frame
# dom-window-fence

浏览器兼容性

参见

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp