HTML::O...:IFrame(3)

πŸ“¦ version 0.6.0, in alpine 3.24

πŸ’… HTML::O...:IFrame(3) β€” like, the whole manual, bestie

okay so this is the page for HTML::Object::DOM::Element::IFrame (the title up top says HTML::O...:IFrame(3), but that's just the man page being lazy with abbreviations πŸ™ˆ). It's a User Contributed Perl Documentation page, and I'm gonna walk you through every single bit of it. Grab a boba πŸ§‹, we're going in.


✨ NAME ✨

HTML::Object::DOM::Element::IFrame β€” the HTML Object DOM iFrame Class. That's it, that's the name. Short, sweet, iconic. πŸ‘‘


πŸŽ€ SYNOPSIS πŸŽ€

use HTML::Object::DOM::Element::IFrame;
my $iframe = HTML::Object::DOM::Element::IFrame->new ||
    die( HTML::Object::DOM::Element::IFrame->error, "\n" );

like the standard new-or-die combo, you know the drill β€” if the constructor fails, it screams its error at you and bails. classic. πŸ’€


πŸ¦‹ VERSION πŸ¦‹

v0.2.0

that's the version, no cap. πŸ’–


🌸 DESCRIPTION 🌸

so the HTML::Object::DOM::Element::IFrame interface gives you special properties and methods β€” beyond the ones it already inherits from the HTML::Object::Element interface β€” for manipulating the layout and presentation of inline frame elements. basically it's the glow-up on top of the base element class for when you're dealing with <iframe> vibes. ✨


🌈 INHERITANCE 🌈

the family tree, bestie, look at it, it's giving royal lineage πŸ‘‘:

+-----------------------+     +---------------------------+     +-------------------------+     +----------------------------+     +------------------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::IFrame |
+-----------------------+     +---------------------------+     +-------------------------+     +----------------------------+     +------------------------------------+

so it inherits down the chain: HTML::Object::Element β†’ HTML::Object::EventTarget β†’ HTML::Object::DOM::Node β†’ HTML::Object::DOM::Element β†’ HTML::Object::DOM::Element::IFrame. main character energy at the end of the line, periodt. πŸ’…


🫢 PROPERTIES 🫢

it inherits properties from its parent HTML::Object::DOM::Element β€” and here's the full roster, no skips:

πŸ’œ align

you hand it a string and it set-or-gets the attribute that specifies the alignment of the frame with respect to the surrounding context.

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLiFrameElement/align

πŸ’œ allow

a list of origins the frame is allowed to display content from. this attribute also accepts the values self and src, which represent the origin in the iframe's src attribute. the default value is src.

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLiFrameElement/allow

πŸ’œ allowfullscreen

a boolean value indicating whether the inline frame is willing to be placed into full screen mode. see Using full-screen mode for the details. this defaults to false.

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLiFrameElement/allowfullscreen

πŸ’œ contentDocument

this does nothing and returns undef under the perl environment. πŸ™ˆ

in the JavaScript environment, this returns a Document β€” the active document in the inline frame's nested browsing context.

maybe, in the future, this could fetch the remote page at the specified url, parse the html and return its HTML::Object::DOM object? (that's the maybe, we're manifesting it ✨)

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/contentDocument

πŸ’œ contentWindow

normally this returns undef under perl, but you can set an HTML::Object::DOM::WindowProxy object.

in the JavaScript environment, this returns a WindowProxy β€” the window proxy for the nested browsing context.

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/contentWindow

πŸ’œ csp

you give it a value and this sets or gets the attribute that specifies the Content Security Policy that an embedded document must agree to enforce upon itself.

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/csp

πŸ’œ featurePolicy

read-only.

this does nothing and returns undef under the perl environment.

in the JavaScript environment, this returns the FeaturePolicy interface, which provides a simple API for introspecting the feature policies applied to a specific document.

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/featurePolicy

πŸ’œ frameBorder

you hand it a string ("yes" or "no") or an integer (1 or 0) and it will set or get the HTML attribute indicating whether to create borders between frames.

example, slay:

$iframe->frameBorder = 1;

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLiFrameElement/frameBorder

πŸ’œ height

a string that reflects the height HTML attribute, indicating the height of the frame.

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLiFrameElement/height

πŸ’œ longDesc

a string containing the URI of a long description of the frame.

example:

<img src="some_pic.png" id="myPicture" height="1024" width="512" longdesc="/some/where/longdescription.html" />

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLiFrameElement/longDesc

πŸ’œ marginHeight

a string that is the height of the frame margin.

example:

<iframe src="/some/where" frameborder="0"  name="resource" title="Resource" marginheight="10">

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLiFrameElement/marginHeight

πŸ’œ marginWidth

a string that is the width of the frame margin.

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLiFrameElement/marginWidth

πŸ’œ name

a string that reflects the name HTML attribute, containing a name by which to refer to the frame.

example:

<iframe src="/some/where" frameborder="0"  name="resource" title="Resource" marginheight="10">

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLiFrameElement/name

πŸ’œ referrerPolicy

a string that reflects the "referrerpolicy" HTML attribute, indicating which referrer to use when fetching the linked resource.

you can use whatever value you want, but the values supported by web browsers are:

  • "no-referrer" β€” this means that the "Referer" HTTP header will not be sent.
  • "origin" β€” this means the referrer will be the origin of the page, that is roughly the scheme, the host and the port.
  • "unsafe-url" β€” this means the referrer will include the origin and the path (but not the fragment, password, or username). this case is unsafe, because it can leak path information that has been concealed to third-party by using TLS.
⚠️ ok bestie listen, "unsafe-url" is literally called unsafe for a reason β€” that path info can leak. the manual said it, I'm just making sure you heard it. πŸ’€

example:

my $iframe = $doc->createElement("iframe");
$iframe->src = '/';
$iframe->referrerPolicy = "unsafe-url";
my $body = $doc->getElementsByTagName('body')[0];
$body->appendChild($iframe); # Fetch the image using the complete URL as the referrer

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/referrerPolicy

πŸ’œ sandbox

read-only.

a TokenList object that reflects the sandbox HTML attribute, indicating extra restrictions on the behavior of the nested content.

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLiFrameElement/sandbox

πŸ’œ scrolling

you hand it a string ("true" or "false") and this sets or gets a string indicating whether the browser should provide scrollbars for the frame.

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLiFrameElement/scrolling

πŸ’œ src

a string that reflects the src HTML attribute, containing the address of the content to be embedded. note that programmatically removing an <iframe>'s src attribute (e.g. via "emoveAttribute" in HTML::Object::DOM::Element) causes about:blank to be loaded in the frame in Firefox (from version 65), Chromium-based browsers, and Safari/iOS. 🫠

(and yes, it says "emoveAttribute" in the original β€” I'm not fixing it, I'm just delivering it to you exactly as written. character for character, that's the rule. πŸ’–)

example:

my $iframe = $doc->createElement( 'iframe' );
$iframe->src = '/';
my $body = $doc->getElementsByTagName( 'body' )->[0];
$body->appendChild( $iframe ); # Fetch the image using the complete URL as the referrer

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/src

πŸ’œ srcdoc

this does nothing and returns undef under the perl environment.

in the JavaScript environment, this sets a string representing the content to display in the frame.

example:

var iframe = document.createElement("iframe");
iframe.srcdoc = `<!DOCTYPE html><p>Hello World!</p>`;
document.body.appendChild(iframe);

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLIFrameElement/srcdoc

πŸ’œ width

a string that reflects the width HTML attribute, indicating the width of the frame.

see also the Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLiFrameElement/width


⭐ METHODS ⭐

it inherits methods from its parent HTML::Object::DOM::Element. that's the whole section β€” inherited methods, nothing extra to list. short and efficient, we love to see it. ✨


πŸŽ€ AUTHOR πŸŽ€

Jacques Deguest <jack@deguest.jp> β€” the icon who wrote this. πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹


Copyright(c) 2021 DEGUEST Pte. Ltd.

All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


okay that's the whole page bestie, every single flag, string, example and link accounted for, no skips, no cap 🫢

signing off with the boring-but-required bits: this beauty is perl v5.42.2, dated 2026-02-15, and yes the footer also says HTML::O...:IFrame(3) again because man pages love a little encore. go build something iconic with your iframes πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from