HtmlIFrameElement Class

https://html.spec.whatwg.org/multipage/iframe-embed-object.html#htmliframeelement

public sealed class HtmlIFrameElement : HtmlElement
Inheritance
HtmlElement HtmlIFrameElement

Properties

NameDescription
AlignGets or sets the value of the align content attribute.
AllowGets or sets the value of the allow content attribute.
AllowFullscreenGets or sets a value indicating whether the element has the allowfullscreen content attribute.
ContentDocumenthttps://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-iframe-contentdocument
ContentWindowhttps://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-iframe-contentwindow
Credentiallesshttps://wicg.github.io/anonymous-iframe/#dom-htmliframeelement-credentialless: the documents of a credentialless iframe are loaded without credentials and are not subject to the embedder policy of the parent document.
CspGets or sets the value of the csp content attribute (https://w3c.github.io/webappsec-cspee/#dom-htmliframeelement-csp): a policy that the documents loaded into the iframe must enforce (CSP Embedded Enforcement). A valid value is sent in the Sec-Required-CSP header of the requests of the navigations of the iframe, and a response that does not accept it (with an Allow-CSP-From header, or with policies at least as strict) is blocked.
FrameBorderGets or sets the value of the frameborder content attribute.
HeightGets or sets the value of the height content attribute.
LoadingGets or sets the value of the loading content attribute, limited to the known values (the canonical keyword, or the default value).
LongDescGets or sets the longdesc content attribute, as a URL resolved against the base URL of the document.
MarginHeightGets or sets the value of the marginheight content attribute.
MarginWidthGets or sets the value of the marginwidth content attribute.
NameGets or sets the value of the name content attribute.
PermissionsPolicyGets the policy object of the iframe (https://w3c.github.io/webappsec-permissions-policy/#dom-htmliframeelement-permissionspolicy): the features that a document loaded into the iframe would be allowed to use, according to the permissions policy of the document of the iframe and to its allow, allowfullscreen, src, srcdoc and sandbox attributes.
PolicyGets or sets the value of the policy content attribute (https://wicg.github.io/document-policy/#iframe-policy-attribute): the document policy that the documents loaded into the iframe must declare (Document Policy). It is combined with the required policy of the document of the iframe, and sent in the Sec-Required-Document-Policy header of the requests of the navigations of the iframe; a response whose Document-Policy header is not compatible with it is blocked.
ReferrerPolicyGets or sets the value of the referrerpolicy content attribute, limited to the known values (the canonical keyword, or the default value).
SandboxGets the tokens of the sandbox content attribute.
ScrollingGets or sets the value of the scrolling content attribute.
SrcGets or sets the src content attribute, as a URL resolved against the base URL of the document.
Srcdochttps://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-iframe-srcdoc
WidthGets or sets the value of the width content attribute.

Gets or sets the value of the align content attribute.

public string Align { get; set; }

Gets or sets the value of the allow content attribute.

public string Allow { get; set; }

AllowFullscreen

HtmlElements.g.cs

Gets or sets a value indicating whether the element has the allowfullscreen content attribute.

public bool AllowFullscreen { get; set; }

ContentDocument

NavigableContainers.cs

https://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-iframe-contentdocument

public Document? ContentDocument { get; }

https://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-iframe-contentwindow

public Window? ContentWindow { get; }

https://wicg.github.io/anonymous-iframe/#dom-htmliframeelement-credentialless: the documents of a credentialless iframe are loaded without credentials and are not subject to the embedder policy of the parent document.

public bool Credentialless { get; set; }

Gets or sets the value of the csp content attribute (https://w3c.github.io/webappsec-cspee/#dom-htmliframeelement-csp): a policy that the documents loaded into the iframe must enforce (CSP Embedded Enforcement). A valid value is sent in the Sec-Required-CSP header of the requests of the navigations of the iframe, and a response that does not accept it (with an Allow-CSP-From header, or with policies at least as strict) is blocked.

public string Csp { get; set; }

Gets or sets the value of the frameborder content attribute.

public string FrameBorder { get; set; }

Gets or sets the value of the height content attribute.

public string Height { get; set; }

Gets or sets the value of the loading content attribute, limited to the known values (the canonical keyword, or the default value).

public string Loading { get; set; }

Gets or sets the longdesc content attribute, as a URL resolved against the base URL of the document.

public string LongDesc { get; set; }

MarginHeight

HtmlElements.g.cs

Gets or sets the value of the marginheight content attribute.

public string MarginHeight { get; set; }

Gets or sets the value of the marginwidth content attribute.

public string MarginWidth { get; set; }

Gets or sets the value of the name content attribute.

public string Name { get; set; }

PermissionsPolicy

HandWrittenReflection.cs

Gets the policy object of the iframe (https://w3c.github.io/webappsec-permissions-policy/#dom-htmliframeelement-permissionspolicy): the features that a document loaded into the iframe would be allowed to use, according to the permissions policy of the document of the iframe and to its allow, allowfullscreen, src, srcdoc and sandbox attributes.

public PermissionsPolicy PermissionsPolicy { get; }
  • Experimental (WEBPLATEXP0016)

Gets or sets the value of the policy content attribute (https://wicg.github.io/document-policy/#iframe-policy-attribute): the document policy that the documents loaded into the iframe must declare (Document Policy). It is combined with the required policy of the document of the iframe, and sent in the Sec-Required-Document-Policy header of the requests of the navigations of the iframe; a response whose Document-Policy header is not compatible with it is blocked.

[Experimental("WEBPLATEXP0016", UrlFormat = "https://github.com/meziantou/Meziantou.Framework/blob/main/src/Meziantou.Framework.WebPlatform/docs/experimental-apis.md#{0}")]
public string Policy { get; set; }

ReferrerPolicy

HtmlElements.g.cs

Gets or sets the value of the referrerpolicy content attribute, limited to the known values (the canonical keyword, or the default value).

public string ReferrerPolicy { get; set; }

Gets the tokens of the sandbox content attribute.

public DomTokenList Sandbox { get; }

Gets or sets the value of the scrolling content attribute.

public string Scrolling { get; set; }

Gets or sets the src content attribute, as a URL resolved against the base URL of the document.

public string Src { get; set; }

https://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-iframe-srcdoc

public string Srcdoc { get; set; }

Property value

string

Exceptions

TypeErrorException
Trusted Types are enforced and the default policy did not convert the value.

See also

Gets or sets the value of the width content attribute.

public string Width { get; set; }

Methods

NameDescription
GetSvgDocument()https://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-iframe-getsvgdocument
SetSrcdoc(TrustedHtml)The srcdoc setter with a TrustedHtml value (https://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-iframe-srcdoc).

GetSvgDocument()

NavigableContainers.cs

https://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-iframe-getsvgdocument

public Document? GetSvgDocument()

SetSrcdoc(TrustedHtml)

HandWrittenReflection.cs

The srcdoc setter with a TrustedHtml value (https://html.spec.whatwg.org/multipage/iframe-embed-object.html#dom-iframe-srcdoc).

public void SetSrcdoc(TrustedHtml value)