NAME

HTML::Object::DOM::Element::IFrame - HTML Object DOM iFrame Class

SYNOPSIS

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

VERSION

v0.2.0

DESCRIPTION

The HTML::Object::DOM::Element::IFrame interface provides special properties and methods (beyond those of the HTML::Object::Element interface it also has available to it by inheritance) for manipulating the layout and presentation of inline frame elements.

INHERITANCE

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

PROPERTIES

Inherits properties from its parent HTML::Object::DOM::Element

align

Provided with a string and this set or get the attribute that specifies the alignment of the frame with respect to the surrounding context.

See also Mozilla documentation

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 Mozilla documentation

allowfullscreen

A boolean value indicating whether the inline frame is willing to be placed into full screen mode. See Using full-screen mode for details. This defaults to false.

See also Mozilla documentation

contentDocument

This does nothing and returns undef under perl environment.

In 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?

See also Mozilla documentation

contentWindow

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

In JavaScript environment, this returns a WindowProxy, the window proxy for the nested browsing context.

See also Mozilla documentation

csp

Provided with 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 Mozilla documentation

featurePolicy

Read-only.

This does nothing and returns undef under perl environment.

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

See also Mozilla documentation

frameBorder

Provided with a string (yes or no) or a integer (1 or 0) and this will set or get the HTML attribute to indicate whether to create borders between frames.

Example:

$iframe->frameBorder = 1;

See also Mozilla documentation

height

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

See also Mozilla documentation

longDesc

A string that contains 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 Mozilla documentation

marginHeight

A string being the height of the frame margin.

Example:

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

See also Mozilla documentation

marginWidth

A string being the width of the frame margin.

See also Mozilla documentation

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 Mozilla documentation

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 browser are:

no-referrer

This means that the Referer HTTP header will not be sent.

origin

This means that the referrer will be the origin of the page, that is roughly the scheme, the host and the port.

unsafe-url

This means that the referrer will include the origin and the path (but not the fragment, password, or username). This case is unsafe as it can leak path information that has been concealed to third-party by using TLS.

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 Mozilla documentation

sandbox

Read-only.

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

See also Mozilla documentation

scrolling

Provided with a string (true or false) and this set or gets a string that indicates whether the browser should provide scrollbars for the frame.

See also Mozilla documentation

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.

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 Mozilla documentation

srcdoc

This does nothing and returns undef under perl environment.

In JavaScript environment, this sets a string that represents 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 Mozilla documentation

width

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

See also Mozilla documentation

METHODS

Inherits methods from its parent HTML::Object::DOM::Element

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Mozilla documentation, Mozilla documentation on iframe element

COPYRIGHT & LICENSE

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.