Window: fence property
Fenced Frame API
Fenced Frame API
The fence read-only property of the Window interface returns a Fence object instance for the current document context.
Fence objects are only available to documents embedded inside fencedframes (loaded via FencedFrameConfigs) or iframes (loaded via opaque URNs).
[!NOTE] See How do
<fencedframe>s work? for some description aroundFencedFrameConfigs and opaque URNs.
Value
A Fence object instance, or null if the document context does not have access to a Fence object.
Examples
window.fence.reportEvent({
eventType: "click",
eventData: JSON.stringify({ clickX: "123", clickY: "456" }),
destination: ["buyer", "seller"],
});
Specifications
Browser compatibility
See also
- Fenced frames on privacysandbox.google.com
- The Privacy Sandbox on privacysandbox.google.com