HTML::O...::Window(3)
๐ HTML::Object::DOM::Window(3) ๐
okay bestie, welcome to the Window page ๐
this is the HTML Object DOM Window Class, and it's giving main-character energy fr fr.
๐ธ NAME ๐ธ
HTML::Object::DOM::Window โ HTML Object DOM Window Class ๐
โจ SYNOPSIS โจ
use HTML::Object::DOM::Window;
my $window = HTML::Object::DOM::Window->new ||
die( HTML::Object::DOM::Window->error, "\n" );
๐ฆ VERSION ๐ฆ
v0.2.0
๐ DESCRIPTION ๐
The Window interface represents a window containing a DOM document ๐ the document property points to the DOM document loaded in that window. no cap.
A window for a given document can be obtained using the document-defaultView property|HTML::Object::DOM/defaultView โจ
๐ INHERITANCE ๐
+-----------------------+ +---------------------------+ +---------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Window |
+-----------------------+ +---------------------------+ +---------------------------+
๐ PROPERTIES ๐
Inherits properties from its parent HTML::Object::EventTarget ๐ซถ
๐ DOMMatrix ๐
This always returns undef under perl.
Normally, under JavaScript, this returns a reference to a DOMMatrix object, which represents 4x4 matrices, suitable for 2D and 3D operations.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMMatrix
๐ DOMMatrixReadOnly ๐
This always returns undef under perl.
Normally, under JavaScript, this returns a reference to a DOMMatrixReadOnly object, which represents 4x4 matrices, suitable for 2D and 3D operations.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMMatrixReadOnly
๐ DOMPoint ๐
This always returns undef under perl.
Normally, under JavaScript, this returns a reference to a DOMPoint object, which represents a 2D or 3D point in a coordinate system.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMPoint
๐ DOMPointReadOnly ๐
This always returns undef under perl.
Normally, under JavaScript, this returns a reference to a DOMPointReadOnly object, which represents a 2D or 3D point in a coordinate system.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMPointReadOnly
๐ DOMQuad ๐
This always returns undef under perl.
Normally, under JavaScript, this returns a reference to a DOMQuad object, which provides represents a quadrilaterial object, that is one having four corners and four sides.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMQuad
๐ DOMRect ๐
This always returns undef under perl.
Normally, under JavaScript, this returns a reference to a DOMRect object, which represents a rectangle.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMRect
๐ DOMRectReadOnly ๐
This always returns undef under perl.
Normally, under JavaScript, this returns a reference to a DOMRectReadOnly object, which represents a rectangle.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMRectReadOnly
๐ clientInformation ๐
This always returns undef under perl.
Normally, under JavaScript, this is an alias for Window.navigator.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator
๐ closed ๐
This always returns undef under perl.
Normally, under JavaScript, this property indicates whether the current window is closed or not.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/closed
๐ console ๐
This always returns undef under perl.
Normally, under JavaScript, this returns a reference to the console object which provides access to the browser's debugging console.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/console
๐ crypto ๐
This always returns undef under perl.
Normally, under JavaScript, this returns the browser crypto object.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/crypto_property
๐ customElements ๐
This always returns undef under perl.
Normally, under JavaScript, this returns a reference to the CustomElementRegistry object, which can be used to register new custom elements and get information about previously registered custom elements.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/customElements
๐ devicePixelRatio ๐
This always returns undef under perl.
Normally, under JavaScript, this returns the ratio between physical pixels and device independent pixels in the current display.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio
๐ document ๐
Read-only.
Returns a reference to the document that the window contains.
Example:
my $parser = HTML::Object::DOM->new;
$parser->parse_data( $html );
say( $parser->window->document->title );
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/document
๐ event ๐
Read-only.
Returns the current event, which is the event currently being handled by the "JavaScript" code's context, or undefined if no event is currently being handled. The Event object passed directly to event handlers should be used instead whenever possible.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/event
๐ frameElement ๐
This always returns undef under perl.
Normally, under JavaScript, this returns the element in which the window is embedded, or undef if the window is not embedded.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/frameElement
๐ frames ๐
Read-only.
Returns an array of the subframes in the current window.
Example:
my $frameList = $parser->window->frames;
my $frames = $parser->window->frames; # or my $frames = $parser->window->parent->frames;
for( my $i = 0; $i < $frames->length; $i++ )
{
# do something with each subframe as $frames->[$i]
$frames->[$i]->document->body->style->background = "red";
}
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/frames
๐ fullScreen ๐
This boolean value is set to false under perl, but you can change it.
Normally, under JavaScript, this property indicates whether the window is displayed in full screen or not.
Example:
if( $parser->window->fullScreen ) {
# it's fullscreen!
}
else {
# not fullscreen!
}
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/fullScreen
๐ history ๐
This always returns undef under perl.
Normally, under JavaScript, this returns a reference to the history object.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/history
๐ innerHeight ๐
Normally this is read-only, but under perl you can set whatever number value you want.
Under JavaScript, this gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
Example:
my $intViewportHeight = $parser->window->innerHeight;
my $intFrameHeight = $parser->window->innerHeight; # or
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/innerHeight
๐ innerWidth ๐
Normally this is read-only, but under perl you can set whatever number value you want.
Under JavaScript, this gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
Example:
my $intViewportWidth = $parser->window->innerWidth;
# This will return the width of the viewport
my $intFrameWidth = $parser->window->innerWidth;
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth
๐ is_property ๐
Provided with a property name and this will return true if it is indeed a window property or false otherwise.
๐ isSecureContext ๐
This is not used under perl, but you can set whatever boolean value you want. By default this returns true.
Normally, under JavaScript, this indicates whether a context is capable of using features that require secure contexts.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/isSecureContext
๐ length ๐
Read-only.
Returns the number of frames in the window. See also "frames".
Example:
if( $parser->window->length ) {
# this is a document with subframes
}
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/length
๐ localStorage ๐
This always returns undef under perl.
Normally, under JavaScript, this returns a reference to the local storage object used to store data that may only be accessed by the origin that created it.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
๐ location ๐
By default, this returns undef, but you can set it to whatever URI you want. If set, it will return a URI object.
Gets/sets the location, or current URL, of the window object.
Example:
say( $parser->window->location ); # alerts "https://example.org/some/where"
$parser->window->location->assign( "https://example.org" ); # or
$parser->window->location = "https://example.org";
Another example:
$parser->window->location->reload();
Another example:
sub reloadPageWithHash() {
my $initialPage = $parser->window->location->pathname;
$parser->window->location->replace('http://example.org/#' + $initialPage);
}
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/location
๐ locationbar ๐
This always returns undef under perl.
Normally, under JavaScript, this returns the locationbar object, whose visibility can be toggled in the window.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/locationbar
๐ menubar ๐
This always returns undef under perl.
Normally, under JavaScript, this returns the menubar object, whose visibility can be toggled in the window.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/menubar
๐ messageManager ๐
This always returns undef under perl.
Normally, under JavaScript, this returns the message manager object for this window.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/messageManager
๐ mozInnerScreenX ๐
This always returns undef under perl.
Normally, under JavaScript, this hands you the horizontal (X) coordinate of the top-left corner of the window's viewport, in screen coordinates. It's reported in CSS pixels, bestie โ check out mozScreenPixelsPerCSSPixel in nsIDOMWindowUtils for the conversion factor if you need to adapt it to actual screen pixels.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/mozInnerScreenX
mozInnerScreenY
This one always returns undef under perl. ๐
Normally, under JavaScript, it gives you the vertical (Y) coordinate of the top-left corner of the window's viewport, in screen coordinates. Reported in CSS pixels โ mozScreenPixelsPerCSSPixel is your conversion factor for screen pixels if that's what you need.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/mozInnerScreenY
name
Gets/sets the name of the window. ๐ท๏ธ
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/name
navigator
This always returns undef under perl.
Normally, under JavaScript, it hands back a reference to the navigator object.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator
onerror
Sets the event listener for when error occur on this window interface. ๐จ
onlanguagechange
Sets the event listener for when the language is changed. Heads up: this event does not get fired automatically โ you can trigger it yourself though. See HTML::Object::DOM::EventTarget.
onorientationchange
Sets the event listener for when there is a change of orientation. Same deal: this event does not get fired automatically, but you're free to trigger it yourself. See HTML::Object::DOM::EventTarget. ๐ฑ
onresize
Sets the event listener for when the screen gets resized. Again โ not fired automatically, trigger it yourself if you want it. See HTML::Object::DOM::EventTarget.
onstorage
Sets the event listener for when the screen storage facility has been changed. Nope, not fired automatically either โ trigger it yourself. See HTML::Object::DOM::EventTarget.
opener
This always returns undef under perl.
Normally, under JavaScript, it returns a reference to the window that opened this current window.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/opener
outerHeight
Normally this is read-only, but under perl you can set whatever number value you want. ๐
Under JavaScript, this gets the height of the outside of the browser window.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/outerHeight
outerWidth
Normally read-only, but under perl you can set whatever number value you want โ go off.
Under JavaScript, this gets the width of the outside of the browser window.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/outerWidth
pageXOffset
This always returns undef under perl.
Normally, under JavaScript, this is just an alias for window.scrollX.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX
pageYOffset
This always returns undef under perl.
Normally, under JavaScript, this is an alias for window.scrollY.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY
parent
Read-only. ๐
Returns a reference to the parent of the current window or subframe, if there is one. By default it returns undef, but you can set it to a window object.
Example, bestie:
my $parentWindow = $parser->window->parent;
if( $parser->window->parent != $parser->window->top) {
# We're deeper than one down
}
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/parent
performance
Read-only.
This always returns undef under perl.
Normally, under JavaScript, it returns a Performance object, which includes the timing and navigation attributes โ each of those is an object serving up performance-related data. See also Using Navigation Timing for more info and examples.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/performance_property
personalbar
This always returns undef under perl.
Normally, under JavaScript, it returns the personalbar object, whose visibility you can toggle in the window.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/personalbar
screen
Read-only.
Returns a reference to the screen object associated with the window. ๐ฅ๏ธ
Example:
use HTML::Object::DOM qw( window screen );
if( screen->pixelDepth < 8 ) {
# use low-color version of page
} else {
# use regular, colorful page
}
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/screen
screenX
This always returns undef under perl.
Normally, under JavaScript, both properties return the horizontal distance from the left border of the user's browser viewport to the left side of the screen.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/screenX
screenY
This always returns undef under perl.
Normally, under JavaScript, both properties return the vertical distance from the top border of the user's browser viewport to the top side of the screen.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/screenY
scrollMaxX
This always returns undef under perl.
Normally, under JavaScript, it returns the maximum offset the window can be scrolled to horizontally โ that's the document width minus the viewport width, iykyk.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollMaxX
scrollMaxY
This always returns undef under perl.
Normally, under JavaScript, it returns the maximum offset the window can be scrolled to vertically (i.e., the document height minus the viewport height).
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollMaxY
scrollX
Normally this is read-only, but under perl you can set whatever number value you want. By default this is undef. โจ
Under JavaScript, it returns the number of pixels the document has already been scrolled horizontally.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX
scrollY
Normally this is read-only, but under perl you can set whatever number value you want. By default this is undef.
Under JavaScript, it returns the number of pixels the document has already been scrolled vertically.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY
scrollbars
This always returns undef under perl.
Normally, under JavaScript, it returns the scrollbars object, whose visibility can be toggled in the window.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollbars
self
Read-only.
Returns an object reference to the window object itself. ๐ช
Example:
use HTML::Object::DOM qw( window );
if( window->parent->frames->[0] != window->self )
{
# this window is not the first frame in the list
}
my $w1 = window;
my $w2 = self;
my $w3 = window->window;
my $w4 = window->self;
# $w1, $w2, $w3, $w4 all strictly equal, but only $w2 will sub in workers
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/self
sessionStorage
This always returns undef under perl.
Normally, under JavaScript, it returns a reference to the session storage object โ that's the one used to store data that may only be accessed by the origin that created it.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage
sidebar
This always returns undef under perl.
Normally, under JavaScript, it returns a reference to the window object of the sidebar.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/sidebar
speechSynthesis
This always returns undef under perl.
Normally, under JavaScript, it returns a SpeechSynthesis object โ the entry point into using Web Speech API speech synthesis functionality. ๐ฃ๏ธ
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/speechSynthesis
status
Normally this is read-only, but under perl you can set whatever text value you want. It returns a scalar object.
Under JavaScript, this gets/sets the text in the statusbar at the bottom of the browser.
Example:
use HTML::Object::DOM qw( window );
window->status = $string;
my $value = window->status;
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/status
statusbar
This always returns undef under perl.
Normally, under JavaScript, this returns the statusbar object, whose visibility can be toggled in the window.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/statusbar
toolbar
This always returns undef under perl.
Normally, under JavaScript, this returns the toolbar object, whose visibility can be toggled in the window.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/toolbar
top
Normally this is read-only, but under perl you can set whatever window object you want.
Under JavaScript, it returns a reference to the topmost window in the window hierarchy. This property is read only. ๐
Example:
use HTML::Object::DOM qw( window );
my $topWindow = window->top;
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/top
visualViewport
Normally this is read-only, but under perl you can set whatever number value you want.
Under JavaScript, this is a VisualViewport object which represents the visual viewport for a given window.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/Window/visualViewport
window
Read-only.
Returns a reference to the current window. ๐ช
Example:
use HTML::Object::DOM qw( window );
window->window
window->window->window
window->window->window->window
# ...
my $global = {data: 0};
say( $global == window->global ); # displays "true"
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/window ๐
๐ฅ METHODS ๐ฅ
Bestie, everything here is inherited from the parent class, HTML::Object::EventTarget โ like, the whole family tree of methods comes down to this window. ๐ซถ
alert
So under perl, this one just calls warn in perlfunc and passes it whatever args you threw at it โ that's the whole thing, no popup, no drama. ๐ซ
Under JavaScript though? It pops a whole alert dialog. Very "pay attention to me" energy.
Example:
use HTML::Object::DOM qw( window );
my $parser = HTML::Object::DOM->new;
window->alert( $message );
window->alert( "Hello world!" );
$parser->window->alert( "Hello world!" );
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/alert
blur
Lowkey does nothing here โ this always returns undef under perl. Under JavaScript it normally takes the focus away from the window (rude but iconic).
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/blur
cancelAnimationFrame
Always returns undef under perl, periodt. Under JavaScript it's the one that lets you cancel a callback you'd previously scheduled with Window.requestAnimationFrame โ the undo button for animations, basically.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame
cancelIdleCallback
Returns undef under perl, always. Under JavaScript it cancels a callback you'd already scheduled with Window.requestIdleCallback.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelIdleCallback
captureEvents
Okay so this registers the window to capture, like, all the events of the type you specify. ๐
Example:
use HTML::Object::DOM qw( window );
use HTML::Object::Event qw( events );
window->captureEvents( CLICK );
window->onclick = \&page_click;
Also note, you can pass a list of events using this syntax:
window.captureEvents( KEYPRESS | KEYDOWN | KEYUP ).
You can still use it, but ngl it's deprecated โ addEventListener in EventTarget is the main character now.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/captureEvents
clearImmediate
Always undef under perl. Under JavaScript it cancels the repeated execution you set up with setImmediate.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/clearImmediate
close
Under perl this does basically nothing in particular โ vibes only. Under JavaScript it closes the current window ๐ธ
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/close
confirm
Always returns undef under perl. Under JavaScript, it shows a dialog with a message the user has to respond to โ the original "are you sure bestie" moment.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm
dump
So under perl, this uses dump in Data::Dump and prints out whatever data you gave it to STDERR. ๐ซถ
Under JavaScript, it writes a message to the console.
Example:
use HTML::Object::DOM qw( window );
window->dump( $message );
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/dump
find
Always undef under perl. Under JavaScript it searches for a given string in a window.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/find
focus
undef under perl, always. Under JavaScript it sets focus on the current window โจ
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/focus
getComputedStyle
Always undef under perl. Under JavaScript, this grabs the computed style for the element you specify โ and computed style means the actual computed values of all the CSS properties of that element. Very "I checked the receipt" behaviour.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle
getDefaultComputedStyle
Always returns undef under perl. Under JavaScript it gets the default computed style for the element you specify, straight up ignoring author stylesheets โ like it never even saw them ๐
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/window/getDefaultComputedStyle
getSelection
Always undef under perl. Under JavaScript it returns the selection object representing the selected item(s).
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection
matchMedia
Always undef under perl. Under JavaScript it returns a MediaQueryList object representing the media query string you specified.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia
moveBy
Always undef under perl. Under JavaScript it moves the current window by a specified amount โ iconic little scoot ๐ฆ
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/moveBy
moveTo
Always undef under perl. Under JavaScript it moves the window to the coordinates you specify.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/moveTo
open
Under perl, this merely returns a new "window object" โ that's it, that's the whole flex. Under JavaScript it actually opens a new window.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/open
postMessage
Always undef under perl. Under JavaScript it's a secure way for one window to send a string of data to another window โ and the other window doesn't even need to be in the same domain as the first. Cross-domain besties fr fr.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
print
Always undef under perl. Under JavaScript, this opens the Print Dialog so you can print the current document ๐
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/print
prompt
Always undef under perl. Under JavaScript it returns the text the user typed into a prompt dialog.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt
releaseEvents
This releases the window from trapping events of a specific type โ the breakup text to captureEvents's attachment. ๐
Example:
use HTML::Object::DOM qw( window );
window->releaseEvents( KEYPRESS );
Note you can pass a list of events to this method using this syntax:
window->releaseEvents( KEYPRESS | KEYDOWN | KEYUP );
requestAnimationFrame
Always undef under perl. Under JavaScript it tells the browser an animation is in progress and politely requests a repaint of the window for the next animation frame โจ
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame
requestIdleCallback
Always undef under perl. Under JavaScript it lets you schedule tasks during the browser's idle periods โ getting stuff done while nobody's looking ๐ง
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback
resizeBy
Always undef under perl. Under JavaScript it resizes the current window by a certain amount.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/resizeBy
resizeTo
Always undef under perl. Under JavaScript it dynamically resizes the window.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/resizeTo
scroll
Always undef under perl. Under JavaScript it scrolls the window to a particular place in the document ๐
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll
scrollBy
Always undef under perl. Under JavaScript it scrolls the document in the window by the given amount.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy
scrollByLines
Always undef under perl. Under JavaScript it scrolls the document by the given number of lines.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollByLines
scrollByPages
Always undef under perl. Under JavaScript it scrolls the current document by the specified number of pages.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollByPages
scrollTo
Always undef under perl. Under JavaScript it scrolls to a particular set of coordinates in the document.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo
setImmediate
Always undef under perl. Under JavaScript it executes a function after the browser has finished other heavy tasks โ like letting the browser catch its breath first ๐ฎโ๐จ
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate
setResizable
Always undef under perl. Under JavaScript it toggles whether the user is able to resize a window.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/setResizable
showDirectoryPicker
Always undef under perl. Under JavaScript it displays a directory picker which lets the user select a directory ๐
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/showDirectoryPicker
showOpenFilePicker
Always undef under perl. Under JavaScript it shows a file picker that lets a user select one file or multiple files.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker
showSaveFilePicker
Always undef under perl. Under JavaScript it shows a file picker that lets a user save a file.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker
sizeToContent
Always undef under perl. Under JavaScript it sizes the window according to its content.
See also the Mozilla docs: https://developer.mozilla.org/en-US/docs/Web/API/Window/sizeToContent
stop
Always returns undef under perl. Under JavaScript, this method stops window loading โ the โ in the group chat.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/stop>
๐ธ updateCommands ๐ธ
Okay so under perl this one literally always returns "undef" โ like, always, no cap. ๐
In JavaScript-land it normally updates the state of commands of the current chrome window (the UI, bestie). Over here? It's giving decorative.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/updateCommands>
๐ EVENTS ๐
So you know how event listeners work? For any of these events, you can also find the listener by sticking "on" in front of the event type. Cute, right? ๐ซถ
Like, "click" event listeners can be set with the "onclick" method too:
$e->onclick(sub{ # do something });
# or as an lvalue method
$e->onclick = sub{ # do something };
โจ error โจ
Under perl, this fires when this window object encounters an error. Simple as that. ๐ญ
Under JavaScript, this fires when a resource failed to load, or cannot be used. For example, if a script has an execution error or an image can't be found or is invalid. Also available via the onerror property.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event>
๐ UNSUPPORTED EVENTS ๐
Not gonna lie, these events are unsupported under perl. But plot twist: you can still fire them yourself using the "dispatchEvent" in HTML::Object::EventTarget. Main character energy โ you do it yourself. ๐
๐ devicemotion
Fired at a regular interval, indicating the amount of physical force of acceleration the device is receiving and the rate of rotation, if available.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/devicemotion_event>
๐ง deviceorientation
Fired when fresh data is available from the magnetometer orientation sensor about the current orientation of the device as compared to the Earth coordinate frame.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/deviceorientation_event>
๐ธ languagechange
Fired at the global scope object when the user's preferred language changes. Also available via the onlanguagechange property.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/languagechange_event>
๐ฅ orientationchange
Fired when the orientation of the device has changed. Also available via the onorientationchange property.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/orientationchange_event>
๐ฆ resize
Fired when the window has been resized. Also available via the onresize property.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/resize_event>
๐ storage
Fired when a storage area (localStorage or sessionStorage) has been modified in the context of another document. Also available via the onstorage property.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event>
๐ UNSUPPORTED EVENT HANDLERS ๐
Okay so these event handlers do exist โ they're right there, chilling โ but their related events never get fired unless you fire them yourself. So like, don't wait up for them. ๐
๐ onappinstalled
Called when the page is installed as a webapp. See appinstalled event.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/onappinstalled>
โญ onbeforeinstallprompt
An event handler property dispatched before a user is prompted to save a web site to a home screen on mobile.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/onbeforeinstallprompt>
๐ ondevicemotion
Called if accelerometer detects a change (For mobile devices)
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/ondevicemotion>
๐ง ondeviceorientation
Called when the orientation is changed (For mobile devices)
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/ondeviceorientation>
๐ ondeviceorientationabsolute
An event handler property for any device orientation changes.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/ondeviceorientationabsolute>
๐ ondeviceproximity
An event handler property for device proximity event (see "DeviceProximityEvent")
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/ondeviceproximity>
๐ฎ ongamepadconnected
Represents an event handler that will run when a gamepad is connected (when the gamepadconnected event fires).
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/ongamepadconnected>
๐ฎ ongamepaddisconnected
Represents an event handler that will run when a gamepad is disconnected (when the gamepaddisconnected event fires).
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/ongamepaddisconnected>
๐ญ onrejectionhandled
An event handler for handled Promise rejection events.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onrejectionhandled>
๐ธ onuserproximity
An event handler property for user proximity events (see "UserProximityEvent").
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/onuserproximity>
๐ฅฝ onvrdisplayactivate
Represents an event handler that will run when a display is able to be presented to (when the vrdisplayactivate event fires), for example if an HMD has been moved to bring it out of standby, or woken up by being put on.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplayactivate>
๐ฅฝ onvrdisplayblur
Represents an event handler that will run when presentation to a display has been paused for some reason by the browser, OS, or VR hardware (when the vrdisplayblur event fires) โ for example, while the user is interacting with a system menu or browser, to prevent tracking or loss of experience.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplayblur>
๐ฅฝ onvrdisplayconnect
Represents an event handler that will run when a compatible VR device has been connected to the computer (when the vrdisplayconnected event fires).
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplayconnect>
๐ฅฝ onvrdisplaydeactivate
Represents an event handler that will run when a display can no longer be presented to (when the vrdisplaydeactivate event fires), for example if an HMD has gone into standby or sleep mode due to a period of inactivity.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplaydeactivate>
๐ฅฝ onvrdisplaydisconnect
Represents an event handler that will run when a compatible VR device has been disconnected from the computer (when the vrdisplaydisconnected event fires).
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplaydisconnect>
๐ฅฝ onvrdisplayfocus
Represents an event handler that will run when presentation to a display has resumed after being blurred (when the vrdisplayfocus event fires).
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplayfocus>
๐ฅฝ onvrdisplaypresentchange
represents an event handler that will run when the presenting state of a VR device changes โ i.e. goes from presenting to not presenting, or vice versa (when the vrdisplaypresentchange event fires).
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplaypresentchange>
๐ AUTHOR ๐
Jacques Deguest <jack@deguest.jp>
๐ฆ SEE ALSO ๐ฆ
Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/Window>, W3C specifications <https://html.spec.whatwg.org/multipage/window-object.html>, StackOverlow about WindowProxy <https://stackoverflow.com/questions/16092835/windowproxy-and-window-objects>
(yes, that typo is in the original, bestie โ "StackOverlow" stays, we don't edit the icon ๐)
๐ 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.
And that's a wrap on the whole page, bestie!! ๐โจ perl v5.42.2, dated 2026-02-15 โ that's the version and date stamped at the bottom, and honestly? Iconic. Go forth and slay your Windows. ๐ ๐ซถ
๐ฆ where this page comes from
- alpine 3.24: perl-html-object-doc 0.6.0-r1 ยท GPL-1.0-or-later OR Artistic-1.0-Perl
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms