Get to know MDN better
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 HTMLFencedFrameElement interface represents a <fencedframe> element in JavaScript and provides configuration properties.
EventTarget Node Element HTMLElement HTMLFencedFrameElementInherits properties from its parent, HTMLElement.
HTMLFencedFrameElement.allowGets and sets the value of the corresponding <fencedframe> allow attribute, which represents a Permissions Policy applied to the content when it is first embedded.
HTMLFencedFrameElement.configa FencedFrameConfig object, which represents the navigation of a <fencedframe>, i.e., what content will be displayed in it. A FencedFrameConfig is returned from a source such as the Protected Audience API.
HTMLFencedFrameElement.heightGets and sets the value of the corresponding <fencedframe> height attribute, which specifies the height of the element.
HTMLFencedFrameElement.widthGets and sets the value of the corresponding <fencedframe> width attribute, which specifies the width of the element.
To set what content will be shown in a <fencedframe>, a utilizing API (such as Protected Audience or Shared Storage) generates a FencedFrameConfig object, which is then set as the value of the <fencedframe>'s config property.
The following example gets a FencedFrameConfig from a Protected Audience API's ad auction, which is then used to display the winning ad in a <fencedframe>:
Note: resolveToConfig: true must be passed in to the runAdAuction() call to obtain a FencedFrameConfig object. If it is not set, the resulting Promise will resolve to a URN that can only be used in an <iframe>.
| Fenced Frame # htmlfencedframeelement |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jun 24, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.