Class HTMLIFrameElement
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The HTMLIFrameElement interface provides special properties and methods (beyond those of the HTMLElement interface it also has available to it by inheritance) for manipulating the layout and presentation of inline frame elements.
[Value("HTMLIFrameElement")]
public class HTMLIFrameElement : HTMLElement
- Inheritance
-
HTMLIFrameElement
- Inherited Members
Remarks
-The HTML element implementing this interface: iframe
Constructors
HTMLIFrameElement()
public HTMLIFrameElement()
Properties
AdAuctionHeaders
[Value("adAuctionHeaders")]
public bool AdAuctionHeaders { get; set; }
Property Value
Align
[Value("align")]
public string Align { get; set; }
Property Value
Allow
The allow property of the HTMLIFrameElement interface indicates the Permissions Policy specified for this <iframe> element. The policy defines what features are available to the <iframe> element (for example, access to the microphone, camera, battery, web-share, etc.) based on the origin of the request.
[Value("allow")]
public string Allow { get; set; }
Property Value
- string
A string indicates the Permissions Policy specified for this iframe element, each policy must be separated by space.
Remarks
The Permissions Policy specified by the allow attribute implements a further restriction on top of the policy specified in the Permissions-Policy header. It doesn't replace it.
See <iframe>'s Permissions Policy syntax for more details.
It reflects the allow attribute of the iframe element.
AllowFullscreen
The allowFullscreen property of the HTMLIFrameElement interface is a boolean value that reflects the allowfullscreen attribute of the {{HTMLElement("iframe")}} element, indicating whether to allow the iframe's contents to use RequestFullscreen(FullscreenOptions).
[Value("allowFullscreen")]
public bool AllowFullscreen { get; set; }
Property Value
- bool
A boolean value.
Remarks
NOTE
This property is considered a legacy property. Use
allow="fullscreen"and Allow instead.
-Fullscreen API
-RequestFullscreen(FullscreenOptions)
-Permissions Policy
-Permissions-Policy/fullscreen Permissions Policy directive
ContentDocument
If the iframe and the iframe's parent document are Same Origin, returns a Document (that is, the active document in the inline frame's nested browsing context), else returns null.
[Value("contentDocument")]
public Document? ContentDocument { get; }
Property Value
Remarks
ContentWindow
The contentWindow property returns the Window object of an HTMLIFrameElement.
[Value("contentWindow")]
public Window? ContentWindow { get; }
Property Value
Remarks
This attribute is read-only.
Credentialless
NOTE
Experimentalcredentialless property of the HTMLIFrameElement interface indicates whether the {{htmlelement("iframe")}} is credentialless, meaning that documents inside will be loaded using new, ephemeral contexts.
[Value("credentialless")]
public bool Credentialless { get; set; }
Property Value
- bool
A boolean. The default value is
false; set it totrueto make the<iframe>credentialless.
Remarks
Those contexts do not have access to their network, cookies and storage data associated with their origin. Instead, they use new ones, local to the top-level document lifetime. It means any data stored won't be accessible anymore after the user navigates away from the page or reloads it.
In return, the Cross-Origin-Embedder-Policy (COEP) embedding rules can be lifted, so documents with COEP set can embed third-party documents that do not. See IFrame credentialless for a deeper explanation.
Csp
NOTE
Experimentalcsp property of the HTMLIFrameElementinterface specifies the Content Security Policy that an
embedded document must agree to enforce upon itself.
[Value("csp")]
public string Csp { get; set; }
Property Value
- string
A content security policy.
Remarks
FrameBorder
[Value("frameBorder")]
public string FrameBorder { get; set; }
Property Value
Height
The height property of the HTMLIFrameElement interface returns a string that reflects the height attribute of the iframe element, indicating the height of the frame in CSS pixels.
[Value("height")]
public string Height { get; set; }
Property Value
- string
A string indicating the height of the frame in CSS pixels.
Remarks
Loading
The loading property of the HTMLIFrameElement interface is a string that provides a hint to the {{Glossary("user agent")}} indicating whether the iframe should be loaded immediately on page load, or only when it is needed.
[Value("loading")]
public string Loading { get; set; }
Property Value
- string
A string providing a hint to the user agent as to how to best schedule the loading of the iframe.
The possible values are:
Remarks
This can be used to optimize the loading of the document's contents.
Iframes that are visible when the page loads can be downloaded immediately (eagerly), while iframes that are likely to be offscreen on initial page load can be downloaded lazily — just before they will appear in the window's visual viewport.
-The iframe element
-Learn: Web performance
-Lazy loading in the MDN web performance guide
-It's time to lazy-load offscreen iframes! on web.dev
LongDesc
[Value("longDesc")]
public string LongDesc { get; set; }
Property Value
MarginHeight
[Value("marginHeight")]
public string MarginHeight { get; set; }
Property Value
MarginWidth
[Value("marginWidth")]
public string MarginWidth { get; set; }
Property Value
Name
The name property of the HTMLIFrameElement interface is a string value that reflects the name attribute of the iframe element, indicating the specific name of the <iframe> element.
[Value("name")]
public string Name { get; set; }
Property Value
- string
A string.
Remarks
PermissionsPolicy
[Value("permissionsPolicy")]
public PermissionsPolicy PermissionsPolicy { get; }
Property Value
PrivateToken
[Value("privateToken")]
public string PrivateToken { get; set; }
Property Value
ReferrerPolicy
TheHTMLIFrameElement.referrerPolicy
property reflects the HTML referrerpolicy attribute of the
iframe element defining which referrer is sent when fetching the
resource.
[Value("referrerPolicy")]
public string ReferrerPolicy { get; set; }
Property Value
Remarks
Sandbox
The sandbox read-only property of the HTMLIFrameElement interface returns a DOMTokenList indicating extra restrictions on the behavior of the nested content.
[Value("sandbox")]
public DOMTokenList Sandbox { get; }
Property Value
- DOMTokenList
A DOMTokenList. Each item must be one of the tokens listed in the
sandboxattribute of the iframe element.
Remarks
It reflects the sandbox attribute of the iframe element.
Scrolling
[Value("scrolling")]
public string Scrolling { get; set; }
Property Value
Src
The HTMLIFrameElement.src
A string that reflects the src HTML attribute, containing the address of the content to be embedded.
[Value("src")]
public string Src { get; set; }
Property Value
Remarks
Note that programmatically removing an <iframe>'s src attribute (e.g., via RemoveAttribute(string)) causes about:blank to be loaded in the frame.
Srcdoc
The srcdoc property of the HTMLIFrameElement specifies the content of the page.
[Value("srcdoc")]
public Union62 Srcdoc { get; set; }
Property Value
Remarks
Width
The width property of the HTMLIFrameElement interface returns a string that reflects the width attribute of the iframe element, indicating the width of the frame in CSS pixels.
[Value("width")]
public string Width { get; set; }
Property Value
- string
A string indicating the width of the frame in CSS pixels.
Remarks
Methods
GetSVGDocument()
The getSVGDocument() method of the HTMLIFrameElement interface returns the Document object of the embedded SVG.
[Value("getSVGDocument")]
public Document? GetSVGDocument()