Window: fence property
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
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 <fencedframe>
s (loaded via FencedFrameConfig
s) or <iframe>
s (loaded via opaque URNs).
Note: See How do <fencedframe>
s work? for some description around FencedFrameConfig
s and opaque URNs.
Value
Examples
js
window.fence.reportEvent({
eventType: "click",
eventData: JSON.stringify({ clickX: "123", clickY: "456" }),
destination: ["buyer", "seller"],
});
Specifications
Specification |
---|
Fenced Frame # dom-window-fence |
Browser compatibility
BCD tables only load in the browser
See also
- Fenced frames on developers.google.com
- The Privacy Sandbox on developers.google.com