File Coverage

lib/HTML/Object/DOM/Window.pm
Criterion Covered Total %
statement 29 159 18.2
branch 1 4 25.0
condition 0 2 0.0
subroutine 10 128 7.8
pod 121 121 100.0
total 161 414 38.8


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## HTML Object - ~/lib/HTML/Object/DOM/Window.pm
3             ## Version v0.2.0
4             ## Copyright(c) 2021 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2021/12/31
7             ## Modified 2022/09/18
8             ## All rights reserved
9             ##
10             ##
11             ## This program is free software; you can redistribute it and/or modify it
12             ## under the same terms as Perl itself.
13             ##----------------------------------------------------------------------------
14             package HTML::Object::DOM::Window;
15             BEGIN
16             {
17 28     28   228 use strict;
  28         95  
  28         842  
18 28     28   140 use warnings;
  28         65  
  28         773  
19 28     28   144 use parent qw( HTML::Object::EventTarget );
  28         71  
  28         139  
20 28     28   1709 use vars qw( @LVALUE_METHODS $VERSION );
  28         70  
  28         2353  
21             # perl -nE 'print if( s,^sub (\w+) : lvalue.*?$,$1, )' ./lib/HTML/Object/DOM/Window.pm | tr "\n" " "
22 28     28   302 our @LVALUE_METHODS = qw( closed document event frames fullScreen innerHeight innerWidth isSecureContext location name onappinstalled onbeforeinstallprompt ondevicemotion ondeviceorientation ondeviceorientationabsolute ondeviceproximity onerror ongamepadconnected ongamepaddisconnected onlanguagechange onorientationchange onrejectionhandled onresize onstorage onuserproximity onvrdisplayactivate onvrdisplayblur onvrdisplayconnect onvrdisplaydeactivate onvrdisplaydisconnect onvrdisplayfocus onvrdisplaypresentchange outerHeight outerWidth parent screen scrollX scrollY self status top visualViewport );
23 28         479 our $VERSION = 'v0.2.0';
24             };
25              
26 28     28   158 use strict;
  28         56  
  28         494  
27 28     28   134 use warnings;
  28         53  
  28         48218  
28              
29             sub init
30             {
31 69     69 1 5244 my $self = shift( @_ );
32 69         2069 $self->{captureEvents} = 0;
33 69         227 $self->{fullscreen} = 0;
34 69         321 $self->{issecurecontext} = 1;
35 69         205 $self->{_init_strict_use_sub} = 1;
36 69 50       481 $self->SUPER::init( @_ ) || return( $self->pass_error );
37 69         256 return( $self );
38             }
39              
40 0     0 1 0 sub alert { shift; return( warn( @_ ) ); }
  0         0  
41              
42 0     0 1 0 sub blur { return; }
43              
44 0     0 1 0 sub cancelAnimationFrame { return; }
45              
46 0     0 1 0 sub cancelIdleCallback { return; }
47              
48             sub captureEvents
49             {
50 0     0 1 0 my $self = shift( @_ );
51 0         0 my $bit = shift( @_ );
52 0         0 return( $self->{captured_events} |= $bit );
53             }
54              
55 0     0 1 0 sub clearImmediate { return; }
56              
57             # Note: property clientInformation read-only
58 0     0 1 0 sub clientInformation { return; }
59              
60 0     0 1 0 sub close { return( shift->closed(1) ); }
61              
62             # Note: property closed read-only
63 0     0 1 0 sub closed : lvalue { return( shift->_set_get_boolean( 'closed', @_ ) ); }
64              
65 0     0 1 0 sub confirm { return; }
66              
67             # Note: property console read-only
68 0     0 1 0 sub console { return; }
69              
70             # Note: property crypto read-only
71 0     0 1 0 sub crypto { return; }
72              
73             # Note: property customElements read-only
74 0     0 1 0 sub customElements { return; }
75              
76             # Note: property devicePixelRatio read-only
77 0     0 1 0 sub devicePixelRatio { return; }
78              
79             # Note: property document read-only
80 0     0 1 0 sub document : lvalue { return( shift->_set_get_object_lvalue( 'document', 'HTML::Object::DOM::Document', @_ ) ); }
81              
82             # Note: property DOMMatrix read-only
83 0     0 1 0 sub DOMMatrix { return; }
84              
85             # Note: property DOMMatrixReadOnly read-only
86 0     0 1 0 sub DOMMatrixReadOnly { return; }
87              
88             # Note: property DOMPoint read-only
89 0     0 1 0 sub DOMPoint { return; }
90              
91             # Note: property DOMPointReadOnly read-only
92 0     0 1 0 sub DOMPointReadOnly { return; }
93              
94             # Note: property DOMQuad read-only
95 0     0 1 0 sub DOMQuad { return; }
96              
97             # Note: property DOMRect read-only
98 0     0 1 0 sub DOMRect { return; }
99              
100             # Note: property DOMRectReadOnly read-only
101 0     0 1 0 sub DOMRectReadOnly { return; }
102              
103             sub dump
104             {
105 0     0 1 0 my $self = shift( @_ );
106 0 0       0 $self->_load_class( 'Data::Dump' ) || return( $self->pass_error );
107 0         0 return( print( STDERR Data::Dump::dump( @_ ), "\n" ) );
108             }
109              
110             # Note: property event read-only
111 0     0 1 0 sub event : lvalue { return( shift->_set_get_object_lvalue( 'event', 'HTML::Object::Event', @_ ) ); }
112              
113 0     0 1 0 sub find { return; }
114              
115 0     0 1 0 sub focus { return; }
116              
117             # Note: property frameElement read-only
118 0     0 1 0 sub frameElement { return; }
119              
120             # Note: property frames read-only
121             sub frames : lvalue
122             {
123 0     0 1 0 my $self = shift( @_ );
124 0         0 my $results = $self->new_array;
125 0   0     0 my $doc = $self->document || return( $results );
126 0         0 $results = $doc->look_down( _tag => 'iframes' );
127 0         0 return( $results );
128             }
129              
130             # Note: property fullScreen
131 0     0 1 0 sub fullScreen : lvalue { return( shift->_set_get_boolean( 'fullscreen', @_ ) ); }
132              
133 0     0 1 0 sub getComputedStyle { return; }
134              
135 0     0 1 0 sub getDefaultComputedStyle { return; }
136              
137 0     0 1 0 sub getSelection { return; }
138              
139             # Note: property history read-only
140 0     0 1 0 sub history { return; }
141              
142             # Note: property innerHeight read-only
143 0     0 1 0 sub innerHeight : lvalue { return( shift->_set_get_number( 'innerheight', @_ ) ); }
144              
145             # Note: property innerWidth read-only
146 0     0 1 0 sub innerWidth : lvalue { return( shift->_set_get_number( 'innerwidth', @_ ) ); }
147              
148             # Note: property isSecureContext read-only
149 0     0 1 0 sub isSecureContext : lvalue { return( shift->_set_get_boolean( 'issecurecontext', @_ ) ); }
150              
151             # Note: property length read-only
152 0     0 1 0 sub length { return( shift->frames->length ); }
153              
154             # Note: property localStorage read-only
155 0     0 1 0 sub localStorage { return; }
156              
157             # Note: property location
158 0     0 1 0 sub location : lvalue { return( shift->_set_get_uri( 'location', @_ ) ); }
159              
160             # Note: property locationbar read-only
161 0     0 1 0 sub locationbar { return; }
162              
163 0     0 1 0 sub matchMedia { return; }
164              
165             # Note: property menubar read-only
166 0     0 1 0 sub menubar { return; }
167              
168             # Note: property messageManager
169 0     0 1 0 sub messageManager { return; }
170              
171 0     0 1 0 sub moveBy { return; }
172              
173 0     0 1 0 sub moveTo { return; }
174              
175             # Note: property mozInnerScreenX read-only
176 0     0 1 0 sub mozInnerScreenX { return; }
177              
178             # Note: property mozInnerScreenY read-only
179 0     0 1 0 sub mozInnerScreenY { return; }
180              
181             # Note: property name
182 0     0 1 0 sub name : lvalue { return( shift->_set_get_scalar_as_object( 'name', @_ ) ); }
183              
184             # Note: property navigator read-only
185 0     0 1 0 sub navigator { return; }
186              
187 0     0 1 0 sub onappinstalled : lvalue { return( shift->on( 'appinstalled', @_ ) ); }
188              
189 0     0 1 0 sub onbeforeinstallprompt : lvalue { return( shift->on( 'beforeinstallprompt', @_ ) ); }
190              
191 0     0 1 0 sub ondevicemotion : lvalue { return( shift->on( 'devicemotion', @_ ) ); }
192              
193 0     0 1 0 sub ondeviceorientation : lvalue { return( shift->on( 'deviceorientation', @_ ) ); }
194              
195 0     0 1 0 sub ondeviceorientationabsolute : lvalue { return( shift->on( 'deviceorientationabsolute', @_ ) ); }
196              
197 0     0 1 0 sub ondeviceproximity : lvalue { return( shift->on( 'deviceproximity', @_ ) ); }
198              
199 0     0 1 0 sub onerror : lvalue { return( shift->on( 'error', @_ ) ); }
200              
201 0     0 1 0 sub ongamepadconnected : lvalue { return( shift->on( 'gamepadconnected', @_ ) ); }
202              
203 0     0 1 0 sub ongamepaddisconnected : lvalue { return( shift->on( 'gamepaddisconnected', @_ ) ); }
204              
205 0     0 1 0 sub onlanguagechange : lvalue { return( shift->on( 'languagechange', @_ ) ); }
206              
207 0     0 1 0 sub onorientationchange : lvalue { return( shift->on( 'orientationchange', @_ ) ); }
208              
209 0     0 1 0 sub onrejectionhandled : lvalue { return( shift->on( 'rejectionhandled', @_ ) ); }
210              
211 0     0 1 0 sub onresize : lvalue { return( shift->on( 'resize', @_ ) ); }
212              
213 0     0 1 0 sub onstorage : lvalue { return( shift->on( 'storage', @_ ) ); }
214              
215 0     0 1 0 sub onuserproximity : lvalue { return( shift->on( 'userproximity', @_ ) ); }
216              
217 0     0 1 0 sub onvrdisplayactivate : lvalue { return( shift->on( 'vrdisplayactivate', @_ ) ); }
218              
219 0     0 1 0 sub onvrdisplayblur : lvalue { return( shift->on( 'vrdisplayblur', @_ ) ); }
220              
221 0     0 1 0 sub onvrdisplayconnect : lvalue { return( shift->on( 'vrdisplayconnect', @_ ) ); }
222              
223 0     0 1 0 sub onvrdisplaydeactivate : lvalue { return( shift->on( 'vrdisplaydeactivate', @_ ) ); }
224              
225 0     0 1 0 sub onvrdisplaydisconnect : lvalue { return( shift->on( 'vrdisplaydisconnect', @_ ) ); }
226              
227 0     0 1 0 sub onvrdisplayfocus : lvalue { return( shift->on( 'vrdisplayfocus', @_ ) ); }
228              
229 0     0 1 0 sub onvrdisplaypresentchange : lvalue { return( shift->on( 'vrdisplaypresentchange', @_ ) ); }
230              
231 0     0 1 0 sub open { return( shift->new( @_ ) ); }
232              
233             # Note: property opener
234 0     0 1 0 sub opener { return; }
235              
236             # Note: property outerHeight read-only
237 0     0 1 0 sub outerHeight : lvalue { return( shift->_set_get_number( 'outerheight', @_ ) ); }
238              
239             # Note: property outerWidth read-only
240 0     0 1 0 sub outerWidth : lvalue { return( shift->_set_get_number( 'outerwidth', @_ ) ); }
241              
242             # Note: property pageXOffset read-only
243 0     0 1 0 sub pageXOffset { return; }
244              
245             # Note: property pageYOffset read-only
246 0     0 1 0 sub pageYOffset { return; }
247              
248             # Note: property parent read-only
249 138     138 1 7965 sub parent : lvalue { return( shift->_set_get_object_lvalue( 'parent', 'HTML::Object::DOM::Window', @_ ) ); }
250              
251             # Note: property performance read-only
252 0     0 1 0 sub performance { return; }
253              
254             # Note: property personalbar read-only
255 0     0 1 0 sub personalbar { return; }
256              
257 0     0 1 0 sub postMessage { return; }
258              
259 0     0 1 0 sub print { return; }
260              
261 0     0 1 0 sub prompt { return; }
262              
263             sub releaseEvents
264             {
265 0     0 1 0 my $self = shift( @_ );
266 0         0 my $bit = shift( @_ );
267 0         0 $self->{captured_events} = ( $self->{captured_events} ^ $bit );
268 0         0 return( $self->{captured_events} );
269             }
270              
271 0     0 1 0 sub requestAnimationFrame { return; }
272              
273 0     0 1 0 sub requestIdleCallback { return; }
274              
275 0     0 1 0 sub resizeBy { return; }
276              
277 0     0 1 0 sub resizeTo { return; }
278              
279             # Note: property screen read-only
280 69     69 1 382 sub screen : lvalue { return( shift->_set_get_object_lvalue( 'screen', 'HTML::Object::DOM::Screen', @_ ) ); }
281              
282             # Note: property screenX read-only
283 0     0 1   sub screenX { return; }
284              
285             # Note: property screenY read-only
286 0     0 1   sub screenY { return; }
287              
288 0     0 1   sub scroll { return; }
289              
290 0     0 1   sub scrollBy { return; }
291              
292 0     0 1   sub scrollByLines { return; }
293              
294 0     0 1   sub scrollByPages { return; }
295              
296             # Note: property scrollMaxX read-only
297 0     0 1   sub scrollMaxX { return; }
298              
299             # Note: property scrollMaxY read-only
300 0     0 1   sub scrollMaxY { return; }
301              
302 0     0 1   sub scrollTo { return; }
303              
304             # Note: property scrollX read-only
305 0     0 1   sub scrollX : lvalue { return( shift->_set_get_number( 'scrollx', @_ ) ); }
306              
307             # Note: property scrollY read-only
308 0     0 1   sub scrollY : lvalue { return( shift->_set_get_number( 'scrolly', @_ ) ); }
309              
310             # Note: property scrollbars read-only
311 0     0 1   sub scrollbars { return; }
312              
313             # Note: property self read-only
314 0     0 1   sub self : lvalue { return( shift( @_ ) ); }
315              
316             # Note: property sessionStorage
317 0     0 1   sub sessionStorage { return; }
318              
319 0     0 1   sub setImmediate { return; }
320              
321 0     0 1   sub setResizable { return; }
322              
323 0     0 1   sub showDirectoryPicker { return; }
324              
325 0     0 1   sub showOpenFilePicker { return; }
326              
327 0     0 1   sub showSaveFilePicker { return; }
328              
329             # Note: property sidebar read-only
330 0     0 1   sub sidebar { return; }
331              
332 0     0 1   sub sizeToContent { return; }
333              
334             # Note: property speechSynthesis read-only
335 0     0 1   sub speechSynthesis { return; }
336              
337             # Note: property status
338 0     0 1   sub status : lvalue { return( shift->_set_get_scalar_as_object( 'status', @_ ) ); }
339              
340             # Note: property statusbar read-only
341 0     0 1   sub statusbar { return; }
342              
343 0     0 1   sub stop { return; }
344              
345             # Note: property toolbar read-only
346 0     0 1   sub toolbar { return; }
347              
348             # Note: property top read-only
349 0     0 1   sub top : lvalue { return( shift->_set_get_object_lvalue( 'top', 'HTML::Object::DOM::Window', @_ ) ); }
350              
351 0     0 1   sub updateCommands { return; }
352              
353             # Note: property visualViewport read-only
354 0     0 1   sub visualViewport : lvalue { return( shift->_set_get_number( 'visualviewport', @_ ) ); }
355              
356             # Note: property window read-only
357 0     0 1   sub window { return( shift( @_ ) ); }
358              
359 0     0 1   sub is_property { return( scalar( grep( /^$_[1]$/i, @LVALUE_METHODS ) ) ); }
360              
361             1;
362             # NOTE: POD
363             __END__
364              
365             =encoding utf-8
366              
367             =head1 NAME
368              
369             HTML::Object::DOM::Window - HTML Object DOM Window Class
370              
371             =head1 SYNOPSIS
372              
373             use HTML::Object::DOM::Window;
374             my $window = HTML::Object::DOM::Window->new ||
375             die( HTML::Object::DOM::Window->error, "\n" );
376              
377             =head1 VERSION
378              
379             v0.2.0
380              
381             =head1 DESCRIPTION
382              
383             The Window interface represents a window containing a L<DOM document|HTML::Object::DOM::Document>; the L<document property|/document> points to the L<DOM document|HTML::Object::DOM::Document> loaded in that window.
384              
385             A window for a given document can be obtained using the L<document->defaultView property|HTML::Object::DOM/defaultView.
386              
387             =head1 INHERITANCE
388              
389             +-----------------------+ +---------------------------+ +---------------------------+
390             | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Window |
391             +-----------------------+ +---------------------------+ +---------------------------+
392              
393             =head1 PROPERTIES
394              
395             Inherits properties from its parent L<HTML::Object::EventTarget>
396              
397             =head2 DOMMatrix
398              
399             This always returns C<undef> under perl.
400              
401             Normally, under JavaScript, this returns a reference to a C<DOMMatrix> object, which represents 4x4 matrices, suitable for 2D and 3D operations.
402              
403             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMMatrix>
404              
405             =head2 DOMMatrixReadOnly
406              
407             This always returns C<undef> under perl.
408              
409             Normally, under JavaScript, this returns a reference to a C<DOMMatrixReadOnly> object, which represents 4x4 matrices, suitable for 2D and 3D operations.
410              
411             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMMatrixReadOnly>
412              
413             =head2 DOMPoint
414              
415             This always returns C<undef> under perl.
416              
417             Normally, under JavaScript, this returns a reference to a C<DOMPoint> object, which represents a 2D or 3D point in a coordinate system.
418              
419             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMPoint>
420              
421             =head2 DOMPointReadOnly
422              
423             This always returns C<undef> under perl.
424              
425             Normally, under JavaScript, this returns a reference to a C<DOMPointReadOnly> object, which represents a 2D or 3D point in a coordinate system.
426              
427             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMPointReadOnly>
428              
429             =head2 DOMQuad
430              
431             This always returns C<undef> under perl.
432              
433             Normally, under JavaScript, this returns a reference to a C<DOMQuad> object, which provides represents a quadrilaterial object, that is one having four corners and four sides.
434              
435             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMQuad>
436              
437             =head2 DOMRect
438              
439             This always returns C<undef> under perl.
440              
441             Normally, under JavaScript, this returns a reference to a C<DOMRect> object, which represents a rectangle.
442              
443             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMRect>
444              
445             =head2 DOMRectReadOnly
446              
447             This always returns C<undef> under perl.
448              
449             Normally, under JavaScript, this returns a reference to a C<DOMRectReadOnly> object, which represents a rectangle.
450              
451             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/DOMRectReadOnly>
452              
453             =head2 clientInformation
454              
455             This always returns C<undef> under perl.
456              
457             Normally, under JavaScript, this is an alias for Window.navigator.
458              
459             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator>
460              
461             =head2 closed
462              
463             This always returns C<undef> under perl.
464              
465             Normally, under JavaScript, this property indicates whether the current window is closed or not.
466              
467             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/closed>
468              
469             =head2 console
470              
471             This always returns C<undef> under perl.
472              
473             Normally, under JavaScript, this returns a reference to the console object which provides access to the browser's debugging console.
474              
475             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/console>
476              
477             =head2 crypto
478              
479             This always returns C<undef> under perl.
480              
481             Normally, under JavaScript, this returns the browser crypto object.
482              
483             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/crypto_property>
484              
485             =head2 customElements
486              
487             This always returns C<undef> under perl.
488              
489             Normally, under JavaScript, this returns a reference to the C<CustomElementRegistry> object, which can be used to register new custom elements and get information about previously registered custom elements.
490              
491             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/customElements>
492              
493             =head2 devicePixelRatio
494              
495             This always returns C<undef> under perl.
496              
497             Normally, under JavaScript, this returns the ratio between physical pixels and device independent pixels in the current display.
498              
499             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio>
500              
501             =head2 document
502              
503             Read-only.
504              
505             Returns a reference to the L<document|HTML::Object::DOM::Document> that the window contains.
506              
507             Example:
508              
509             my $parser = HTML::Object::DOM->new;
510             $parser->parse_data( $html );
511             say( $parser->window->document->title );
512              
513             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/document>
514              
515             =head2 event
516              
517             Read-only.
518              
519             Returns the current event, which is the event currently being handled by the C<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.
520              
521             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/event>
522              
523             =head2 frameElement
524              
525             This always returns C<undef> under perl.
526              
527             Normally, under JavaScript, this returns the element in which the window is embedded, or C<undef> if the window is not embedded.
528              
529             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/frameElement>
530              
531             =head2 frames
532              
533             Read-only.
534              
535             Returns an array of the subframes in the current window.
536              
537             Example:
538              
539             my $frameList = $parser->window->frames;
540              
541             my $frames = $parser->window->frames; # or my $frames = $parser->window->parent->frames;
542             for( my $i = 0; $i < $frames->length; $i++ )
543             {
544             # do something with each subframe as $frames->[$i]
545             $frames->[$i]->document->body->style->background = "red";
546             }
547              
548             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/frames>
549              
550             =head2 fullScreen
551              
552             This boolean value is set to false under perl, but you can change it.
553              
554             Normally, under JavaScript, this property indicates whether the window is displayed in full screen or not.
555              
556             Example:
557              
558             if( $parser->window->fullScreen ) {
559             # it's fullscreen!
560             }
561             else {
562             # not fullscreen!
563             }
564              
565             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/fullScreen>
566              
567             =head2 history
568              
569             This always returns C<undef> under perl.
570              
571             Normally, under JavaScript, this returns a reference to the history object.
572              
573             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/history>
574              
575             =head2 innerHeight
576              
577             Normally this is read-only, but under perl you can set whatever number value you want.
578              
579             Under JavaScript, this gets the height of the content area of the browser window including, if rendered, the horizontal scrollbar.
580              
581             Example:
582              
583             my $intViewportHeight = $parser->window->innerHeight;
584              
585             my $intFrameHeight = $parser->window->innerHeight; # or
586              
587             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/innerHeight>
588              
589             =head2 innerWidth
590              
591             Normally this is read-only, but under perl you can set whatever number value you want.
592              
593             Under JavaScript, this gets the width of the content area of the browser window including, if rendered, the vertical scrollbar.
594              
595             Example:
596              
597             my $intViewportWidth = $parser->window->innerWidth;
598              
599             # This will return the width of the viewport
600             my $intFrameWidth = $parser->window->innerWidth;
601              
602             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth>
603              
604             =head2 is_property
605              
606             Provided with a property name and this will return true if it is indeed a window property or false otherwise.
607              
608             =head2 isSecureContext
609              
610             This is not used under perl, but you can set whatever boolean value you want. By default this returns true.
611              
612             Normally, under JavaScript, this indicates whether a context is capable of using features that require secure contexts.
613              
614             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/isSecureContext>
615              
616             =head2 length
617              
618             Read-only.
619              
620             Returns the number of frames in the window. See also L</frames>.
621              
622             Example:
623              
624             if( $parser->window->length ) {
625             # this is a document with subframes
626             }
627              
628             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/length>
629              
630             =head2 localStorage
631              
632             This always returns C<undef> under perl.
633              
634             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.
635              
636             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage>
637              
638             =head2 location
639              
640             By default, this returns C<undef>, but you can set it to whatever URI you want. If set, it will return a L<URI> object.
641              
642             Gets/sets the location, or current URL, of the window object.
643              
644             Example:
645              
646             say( $parser->window->location ); # alerts "https://example.org/some/where"
647              
648             $parser->window->location->assign( "https://example.org" ); # or
649             $parser->window->location = "https://example.org";
650              
651             Another example:
652              
653             $parser->window->location->reload();
654              
655             Another example:
656              
657             sub reloadPageWithHash() {
658             my $initialPage = $parser->window->location->pathname;
659             $parser->window->location->replace('http://example.org/#' + $initialPage);
660             }
661              
662             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/location>
663              
664             =head2 locationbar
665              
666             This always returns C<undef> under perl.
667              
668             Normally, under JavaScript, this returns the locationbar object, whose visibility can be toggled in the window.
669              
670             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/locationbar>
671              
672             =head2 menubar
673              
674             This always returns C<undef> under perl.
675              
676             Normally, under JavaScript, this returns the menubar object, whose visibility can be toggled in the window.
677              
678             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/menubar>
679              
680             =head2 messageManager
681              
682             This always returns C<undef> under perl.
683              
684             Normally, under JavaScript, this returns the message manager object for this window.
685              
686             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/messageManager>
687              
688             =head2 mozInnerScreenX
689              
690             This always returns C<undef> under perl.
691              
692             Normally, under JavaScript, this returns the horizontal (X) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See mozScreenPixelsPerCSSPixel in nsIDOMWindowUtils for a conversion factor to adapt to screen pixels if needed.
693              
694             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/mozInnerScreenX>
695              
696             =head2 mozInnerScreenY
697              
698             This always returns C<undef> under perl.
699              
700             Normally, under JavaScript, this returns the vertical (Y) coordinate of the top-left corner of the window's viewport, in screen coordinates. This value is reported in CSS pixels. See mozScreenPixelsPerCSSPixel for a conversion factor to adapt to screen pixels if needed.
701              
702             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/mozInnerScreenY>
703              
704             =head2 name
705              
706             Gets/sets the name of the window.
707              
708             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/name>
709              
710             =head2 navigator
711              
712             This always returns C<undef> under perl.
713              
714             Normally, under JavaScript, this returns a reference to the navigator object.
715              
716             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator>
717              
718             =head2 onerror
719              
720             Sets the event listener for when error occur on this window interface.
721              
722             =head2 onlanguagechange
723              
724             Sets the event listener for when the language is changed. This event does not get fired automatically, but you can trigger it yourself. See L<HTML::Object::DOM::EventTarget>
725              
726             =head2 onorientationchange
727              
728             Sets the event listener for when there is a change of orientation. This event does not get fired automatically, but you can trigger it yourself. See L<HTML::Object::DOM::EventTarget>
729              
730             =head2 onresize
731              
732             Sets the event listener for when the screen gets resized. This event does not get fired automatically, but you can trigger it yourself. See L<HTML::Object::DOM::EventTarget>
733              
734             =head2 onstorage
735              
736             Sets the event listener for when the screen storage facility has been changed. This event does not get fired automatically, but you can trigger it yourself. See L<HTML::Object::DOM::EventTarget>
737              
738             =head2 opener
739              
740             This always returns C<undef> under perl.
741              
742             Normally, under JavaScript, this returns a reference to the window that opened this current window.
743              
744             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/opener>
745              
746             =head2 outerHeight
747              
748             Normally this is read-only, but under perl you can set whatever number value you want.
749              
750             Under JavaScript, this gets the height of the outside of the browser window.
751              
752             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/outerHeight>
753              
754             =head2 outerWidth
755              
756             Normally this is read-only, but under perl you can set whatever number value you want.
757              
758             Under JavaScript, this gets the width of the outside of the browser window.
759              
760             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/outerWidth>
761              
762             =head2 pageXOffset
763              
764             This always returns C<undef> under perl.
765              
766             Normally, under JavaScript, this is an alias for window.scrollX.
767              
768             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX>
769              
770             =head2 pageYOffset
771              
772             This always returns C<undef> under perl.
773              
774             Normally, under JavaScript, this is an alias for window.scrollY
775              
776             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY>
777              
778             =head2 parent
779              
780             Read-only.
781              
782             Returns a reference to the parent of the current window or subframe, if any. By default this returns C<undef>, but you can set it to a L<window object|HTML::Object::DOM::Window>.
783              
784             Example:
785              
786             my $parentWindow = $parser->window->parent;
787              
788             if( $parser->window->parent != $parser->window->top) {
789             # We're deeper than one down
790             }
791              
792             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/parent>
793              
794             =head2 performance
795              
796             Read-only.
797              
798             This always returns C<undef> under perl.
799              
800             Normally, under JavaScript, this returns a C<Performance> object, which includes the timing and navigation attributes, each of which is an object providing performance-related data. See also Using Navigation Timing for additional information and examples.
801              
802             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/performance_property>
803              
804             =head2 personalbar
805              
806             This always returns C<undef> under perl.
807              
808             Normally, under JavaScript, this returns the personalbar object, whose visibility can be toggled in the window.
809              
810             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/personalbar>
811              
812             =head2 screen
813              
814             Read-only.
815              
816             Returns a reference to the L<screen object|HTML::Object::DOM::Screen> associated with the window.
817              
818             Example:
819              
820             use HTML::Object::DOM qw( window screen );
821             if( screen->pixelDepth < 8 ) {
822             # use low-color version of page
823             } else {
824             # use regular, colorful page
825             }
826              
827             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/screen>
828              
829             =head2 screenX
830              
831             This always returns C<undef> under perl.
832              
833             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.
834              
835             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/screenX>
836              
837             =head2 screenY
838              
839             This always returns C<undef> under perl.
840              
841             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.
842              
843             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/screenY>
844              
845             =head2 scrollMaxX
846              
847             This always returns C<undef> under perl.
848              
849             Normally, under JavaScript, this returns the maximum offset that the window can be scrolled to horizontally, that is the document width minus the viewport width.
850              
851             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollMaxX>
852              
853             =head2 scrollMaxY
854              
855             This always returns C<undef> under perl.
856              
857             Normally, under JavaScript, this returns the maximum offset that the window can be scrolled to vertically (i.e., the document height minus the viewport height).
858              
859             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollMaxY>
860              
861             =head2 scrollX
862              
863             Normally this is read-only, but under perl you can set whatever number value you want. BY default this is C<undef>
864              
865             Under JavaScript, this returns the number of pixels that the document has already been scrolled horizontally.
866              
867             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollX>
868              
869             =head2 scrollY
870              
871             Normally this is read-only, but under perl you can set whatever number value you want. BY default this is C<undef>
872              
873             Under JavaScript, this returns the number of pixels that the document has already been scrolled vertically.
874              
875             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollY>
876              
877             =head2 scrollbars
878              
879             This always returns C<undef> under perl.
880              
881             Normally, under JavaScript, this returns the scrollbars object, whose visibility can be toggled in the window.
882              
883             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollbars>
884              
885             =head2 self
886              
887             Read-only.
888              
889             Returns an object reference to the window object itself.
890              
891             Example:
892              
893             use HTML::Object::DOM qw( window );
894             if( window->parent->frames->[0] != window->self )
895             {
896             # this window is not the first frame in the list
897             }
898              
899             my $w1 = window;
900             my $w2 = self;
901             my $w3 = window->window;
902             my $w4 = window->self;
903             # $w1, $w2, $w3, $w4 all strictly equal, but only $w2 will sub in workers
904              
905             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/self>
906              
907             =head2 sessionStorage
908              
909             This always returns C<undef> under perl.
910              
911             Normally, under JavaScript, this returns a reference to the session storage object used to store data that may only be accessed by the origin that created it.
912              
913             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage>
914              
915             =head2 sidebar
916              
917             This always returns C<undef> under perl.
918              
919             Normally, under JavaScript, this returns a reference to the window object of the sidebar.
920              
921             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/sidebar>
922              
923             =head2 speechSynthesis
924              
925             This always returns C<undef> under perl.
926              
927             Normally, under JavaScript, this returns a C<SpeechSynthesis> object, which is the entry point into using Web Speech API speech synthesis functionality.
928              
929             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/speechSynthesis>
930              
931             =head2 status
932              
933             Normally this is read-only, but under perl you can set whatever text value you want. It returns a L<scalar object|Module::Generic::Scalar>.
934              
935             Under JavaScript, this gets/sets the text in the statusbar at the bottom of the browser.
936              
937             Example:
938              
939             use HTML::Object::DOM qw( window );
940             window->status = $string;
941             my $value = window->status;
942              
943             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/status>
944              
945             =head2 statusbar
946              
947             This always returns C<undef> under perl.
948              
949             Normally, under JavaScript, this return the statusbar object, whose visibility can be toggled in the window.
950              
951             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/statusbar>
952              
953             =head2 toolbar
954              
955             This always returns C<undef> under perl.
956              
957             Normally, under JavaScript, this return the toolbar object, whose visibility can be toggled in the window.
958              
959             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/toolbar>
960              
961             =head2 top
962              
963             Normally this is read-only, but under perl you can set whatever L<window object|HTML::Object::DOM::Window> you want.
964              
965             Under JavaScript, this returns a reference to the topmost window in the window hierarchy. This property is read only.
966              
967             Example:
968              
969             use HTML::Object::DOM qw( window );
970             my $topWindow = window->top;
971              
972             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/top>
973              
974             =head2 visualViewport
975              
976             Normally this is read-only, but under perl you can set whatever number value you want.
977              
978             Under JavaScript, this a C<VisualViewport> object which represents the visual viewport for a given window.
979              
980             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/visualViewport>
981              
982             =head2 window
983              
984             Read-only.
985              
986             Returns a reference to the current window.
987              
988             Example:
989              
990             use HTML::Object::DOM qw( window );
991             window->window
992             window->window->window
993             window->window->window->window
994             # ...
995              
996             my $global = {data: 0};
997             say( $global == window->global ); # displays "true"
998              
999             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/window>
1000              
1001             =head1 METHODS
1002              
1003             Inherits methods from its parent L<HTML::Object::EventTarget>
1004              
1005             =head2 alert
1006              
1007             Under perl, this calls L<perlfunc/warn> passing it whatever arguments you provide.
1008              
1009             Under JavaScript, this displays an alert dialog.
1010              
1011             Example:
1012              
1013             use HTML::Object::DOM qw( window );
1014             my $parser = HTML::Object::DOM->new;
1015             window->alert( $message );
1016              
1017             window->alert( "Hello world!" );
1018             $parser->window->alert( "Hello world!" );
1019              
1020             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/alert>
1021              
1022             =head2 blur
1023              
1024             This always returns C<undef> under perl.
1025              
1026             Normally, under JavaScript, this sets focus away from the window.
1027              
1028             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/blur>
1029              
1030             =head2 cancelAnimationFrame
1031              
1032             This always returns C<undef> under perl.
1033              
1034             Normally, under JavaScript, this enables you to cancel a callback previously scheduled with Window.requestAnimationFrame.
1035              
1036             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelAnimationFrame>
1037              
1038             =head2 cancelIdleCallback
1039              
1040             This always returns C<undef> under perl.
1041              
1042             Normally, under JavaScript, this enables you to cancel a callback previously scheduled with Window.requestIdleCallback.
1043              
1044             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/cancelIdleCallback>
1045              
1046             =head2 captureEvents
1047              
1048             Registers the window to capture all events of the specified type.
1049              
1050             Example:
1051              
1052             use HTML::Object::DOM qw( window );
1053             use HTML::Object::Event qw( events );
1054             window->captureEvents( CLICK );
1055             window->onclick = \&page_click;
1056              
1057             Note that you can pass a list of events to this method using the following syntax:
1058              
1059             window.captureEvents( KEYPRESS | KEYDOWN | KEYUP ).
1060              
1061             Although you can still use it, this method is deprecated in favour of L<EventTarget/addEventListener>
1062              
1063             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/captureEvents>
1064              
1065             =head2 clearImmediate
1066              
1067             This always returns C<undef> under perl.
1068              
1069             Normally, under JavaScript, this cancels the repeated execution set using setImmediate.
1070              
1071             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/clearImmediate>
1072              
1073             =head2 close
1074              
1075             Under perl, this does nothing in particular, but under JavaScript, this closes the current window.
1076              
1077             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/close>
1078              
1079             =head2 confirm
1080              
1081             This always returns C<undef> under perl.
1082              
1083             Normally, under JavaScript, this displays a dialog with a message that the user needs to respond to.
1084              
1085             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/confirm>
1086              
1087             =head2 dump
1088              
1089             Under perl, this use L<Data::Dump/dump> to print out data provided to the C<STDERR>.
1090              
1091             Under JavaScript, this writes a message to the console.
1092              
1093             Example:
1094              
1095             use HTML::Object::DOM qw( window );
1096             window->dump( $message );
1097              
1098             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/dump>
1099              
1100             =head2 find
1101              
1102             This always returns C<undef> under perl.
1103              
1104             Normally, under JavaScript, this searches for a given string in a window.
1105              
1106             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/find>
1107              
1108             =head2 focus
1109              
1110             This always returns C<undef> under perl.
1111              
1112             Normally, under JavaScript, this sets focus on the current window.
1113              
1114             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/focus>
1115              
1116             =head2 getComputedStyle
1117              
1118             This always returns C<undef> under perl.
1119              
1120             Normally, under JavaScript, this gets computed style for the specified element. Computed style indicates the computed values of all CSS properties of the element.
1121              
1122             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/getComputedStyle>
1123              
1124             =head2 getDefaultComputedStyle
1125              
1126             This always returns C<undef> under perl.
1127              
1128             Normally, under JavaScript, this gets default computed style for the specified element, ignoring author stylesheets.
1129              
1130             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/window/getDefaultComputedStyle>
1131              
1132             =head2 getSelection
1133              
1134             This always returns C<undef> under perl.
1135              
1136             Normally, under JavaScript, this returns the selection object representing the selected item(s).
1137              
1138             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection>
1139              
1140             =head2 matchMedia
1141              
1142             This always returns C<undef> under perl.
1143              
1144             Normally, under JavaScript, this returns a C<MediaQueryList> object representing the specified media query string.
1145              
1146             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia>
1147              
1148             =head2 moveBy
1149              
1150             This always returns C<undef> under perl.
1151              
1152             Normally, under JavaScript, this moves the current window by a specified amount.
1153              
1154             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/moveBy>
1155              
1156             =head2 moveTo
1157              
1158             This always returns C<undef> under perl.
1159              
1160             Normally, under JavaScript, this moves the window to the specified coordinates.
1161              
1162             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/moveTo>
1163              
1164             =head2 open
1165              
1166             Under perl, this merely returns a new L<window object>.
1167              
1168             Under JavaScript, this opens a new window.
1169              
1170             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/open>
1171              
1172             =head2 postMessage
1173              
1174             This always returns C<undef> under perl.
1175              
1176             Normally, under JavaScript, this provides a secure means for one window to send a string of data to another window, which need not be within the same domain as the first.
1177              
1178             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage>
1179              
1180             =head2 print
1181              
1182             This always returns C<undef> under perl.
1183              
1184             Normally, under JavaScript, this opens the Print Dialog to print the current document.
1185              
1186             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/print>
1187              
1188             =head2 prompt
1189              
1190             This always returns C<undef> under perl.
1191              
1192             Normally, under JavaScript, this returns the text entered by the user in a prompt dialog.
1193              
1194             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/prompt>
1195              
1196             =head2 releaseEvents
1197              
1198             Releases the window from trapping events of a specific type.
1199              
1200             Example:
1201              
1202             use HTML::Object::DOM qw( window );
1203             window->releaseEvents( KEYPRESS );
1204              
1205             Note that you can pass a list of events to this method using the following syntax:
1206              
1207             window->releaseEvents( KEYPRESS | KEYDOWN | KEYUP );
1208            
1209             =head2 requestAnimationFrame
1210              
1211             This always returns C<undef> under perl.
1212              
1213             Normally, under JavaScript, this tells the browser that an animation is in progress, requesting that the browser schedule a repaint of the window for the next animation frame.
1214              
1215             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame>
1216              
1217             =head2 requestIdleCallback
1218              
1219             This always returns C<undef> under perl.
1220              
1221             Normally, under JavaScript, this enables the scheduling of tasks during a browser's idle periods.
1222              
1223             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback>
1224              
1225             =head2 resizeBy
1226              
1227             This always returns C<undef> under perl.
1228              
1229             Normally, under JavaScript, this resizes the current window by a certain amount.
1230              
1231             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/resizeBy>
1232              
1233             =head2 resizeTo
1234              
1235             This always returns C<undef> under perl.
1236              
1237             Normally, under JavaScript, this dynamically resizes window.
1238              
1239             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/resizeTo>
1240              
1241             =head2 scroll
1242              
1243             This always returns C<undef> under perl.
1244              
1245             Normally, under JavaScript, this scrolls the window to a particular place in the document.
1246              
1247             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scroll>
1248              
1249             =head2 scrollBy
1250              
1251             This always returns C<undef> under perl.
1252              
1253             Normally, under JavaScript, this scrolls the document in the window by the given amount.
1254              
1255             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollBy>
1256              
1257             =head2 scrollByLines
1258              
1259             This always returns C<undef> under perl.
1260              
1261             Normally, under JavaScript, this scrolls the document by the given number of lines.
1262              
1263             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollByLines>
1264              
1265             =head2 scrollByPages
1266              
1267             This always returns C<undef> under perl.
1268              
1269             Normally, under JavaScript, this scrolls the current document by the specified number of pages.
1270              
1271             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollByPages>
1272              
1273             =head2 scrollTo
1274              
1275             This always returns C<undef> under perl.
1276              
1277             Normally, under JavaScript, this scrolls to a particular set of coordinates in the document.
1278              
1279             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/scrollTo>
1280              
1281             =head2 setImmediate
1282              
1283             This always returns C<undef> under perl.
1284              
1285             Normally, under JavaScript, this executes a function after the browser has finished other heavy tasks
1286              
1287             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate>
1288              
1289             =head2 setResizable
1290              
1291             This always returns C<undef> under perl.
1292              
1293             Normally, under JavaScript, this toggles a user's ability to resize a window.
1294              
1295             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/setResizable>
1296              
1297             =head2 showDirectoryPicker
1298              
1299             This always returns C<undef> under perl.
1300              
1301             Normally, under JavaScript, this displays a directory picker which allows the user to select a directory.
1302              
1303             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/showDirectoryPicker>
1304              
1305             =head2 showOpenFilePicker
1306              
1307             This always returns C<undef> under perl.
1308              
1309             Normally, under JavaScript, this shows a file picker that allows a user to select a file or multiple files.
1310              
1311             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/showOpenFilePicker>
1312              
1313             =head2 showSaveFilePicker
1314              
1315             This always returns C<undef> under perl.
1316              
1317             Normally, under JavaScript, this shows a file picker that allows a user to save a file.
1318              
1319             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/showSaveFilePicker>
1320              
1321             =head2 sizeToContent
1322              
1323             This always returns C<undef> under perl.
1324              
1325             Normally, under JavaScript, this sizes the window according to its content.
1326              
1327             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/sizeToContent>
1328              
1329             =head2 stop
1330              
1331             This always returns C<undef> under perl.
1332              
1333             Normally, under JavaScript, this method stops window loading.
1334              
1335             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/stop>
1336              
1337             =head2 updateCommands
1338              
1339             This always returns C<undef> under perl.
1340              
1341             Normally, under JavaScript, this updates the state of commands of the current chrome window (UI).
1342              
1343             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/updateCommands>
1344              
1345             =head1 EVENTS
1346              
1347             Event listeners for those events can also be found by prepending C<on> before the event type:
1348              
1349             C<click> event listeners can be set also with C<onclick> method:
1350              
1351             $e->onclick(sub{ # do something });
1352             # or as an lvalue method
1353             $e->onclick = sub{ # do something };
1354              
1355             =head2 error
1356              
1357             Under perl, this is fired when this window object encounters an error.
1358              
1359             Under JavaScript, this is fired 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.
1360             Also available via the onerror property.
1361              
1362             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event>
1363              
1364             =head1 UNSUPPORTED EVENTS
1365              
1366             The following events are unsupported under perl, but you can still fire them by yourself using the L<HTML::Object::EventTarget/dispatchEvent>
1367              
1368             =head2 devicemotion
1369              
1370             Fired at a regular interval, indicating the amount of physical force of acceleration the device is receiving and the rate of rotation, if available.
1371              
1372             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/devicemotion_event>
1373              
1374             =head2 deviceorientation
1375              
1376             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.
1377              
1378             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/deviceorientation_event>
1379              
1380             =head2 languagechange
1381              
1382             Fired at the global scope object when the user's preferred language changes.
1383             Also available via the onlanguagechange property.
1384              
1385             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/languagechange_event>
1386              
1387             =head2 orientationchange
1388              
1389             Fired when the orientation of the device has changed.
1390             Also available via the onorientationchange property.
1391              
1392             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/orientationchange_event>
1393              
1394             =head2 resize
1395              
1396             Fired when the window has been resized.
1397             Also available via the onresize property.
1398              
1399             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/resize_event>
1400              
1401             =head2 storage
1402              
1403             Fired when a storage area (localStorage or sessionStorage) has been modified in the context of another document.
1404             Also available via the onstorage property.
1405              
1406             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event>
1407              
1408             =head1 UNSUPPORTED EVENT HANDLERS
1409              
1410             Although those event handlers exist, their related events never get fired unless you fire them yourself.
1411              
1412             =head2 onappinstalled
1413              
1414             Called when the page is installed as a webapp. See appinstalled event.
1415              
1416             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onappinstalled>
1417              
1418             =head2 onbeforeinstallprompt
1419              
1420             An event handler property dispatched before a user is prompted to save a web site to a home screen on mobile.
1421              
1422             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onbeforeinstallprompt>
1423              
1424             =head2 ondevicemotion
1425              
1426             Called if accelerometer detects a change (For mobile devices)
1427              
1428             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/ondevicemotion>
1429              
1430             =head2 ondeviceorientation
1431              
1432             Called when the orientation is changed (For mobile devices)
1433              
1434             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/ondeviceorientation>
1435              
1436             =head2 ondeviceorientationabsolute
1437              
1438             An event handler property for any device orientation changes.
1439              
1440             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/ondeviceorientationabsolute>
1441              
1442             =head2 ondeviceproximity
1443              
1444             An event handler property for device proximity event (see C<DeviceProximityEvent>)
1445              
1446             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/ondeviceproximity>
1447              
1448             =head2 ongamepadconnected
1449              
1450             Represents an event handler that will run when a gamepad is connected (when the gamepadconnected event fires).
1451              
1452             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/ongamepadconnected>
1453              
1454             =head2 ongamepaddisconnected
1455              
1456             Represents an event handler that will run when a gamepad is disconnected (when the gamepaddisconnected event fires).
1457              
1458             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/ongamepaddisconnected>
1459              
1460             =head2 onrejectionhandled
1461              
1462             An event handler for handled Promise rejection events.
1463              
1464             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onrejectionhandled>
1465              
1466             =head2 onuserproximity
1467              
1468             An event handler property for user proximity events (see C<UserProximityEvent>).
1469              
1470             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onuserproximity>
1471              
1472             =head2 onvrdisplayactivate
1473              
1474             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.
1475              
1476             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplayactivate>
1477              
1478             =head2 onvrdisplayblur
1479              
1480             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.
1481              
1482             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplayblur>
1483              
1484             =head2 onvrdisplayconnect
1485              
1486             Represents an event handler that will run when a compatible VR device has been connected to the computer (when the vrdisplayconnected event fires).
1487              
1488             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplayconnect>
1489              
1490             =head2 onvrdisplaydeactivate
1491              
1492             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.
1493              
1494             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplaydeactivate>
1495              
1496             =head2 onvrdisplaydisconnect
1497              
1498             Represents an event handler that will run when a compatible VR device has been disconnected from the computer (when the vrdisplaydisconnected event fires).
1499              
1500             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplaydisconnect>
1501              
1502             =head2 onvrdisplayfocus
1503              
1504             Represents an event handler that will run when presentation to a display has resumed after being blurred (when the vrdisplayfocus event fires).
1505              
1506             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplayfocus>
1507              
1508             =head2 onvrdisplaypresentchange
1509              
1510             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).
1511              
1512             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window/onvrdisplaypresentchange>
1513              
1514             =head1 AUTHOR
1515              
1516             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
1517              
1518             =head1 SEE ALSO
1519              
1520             L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/Window>, L<W3C specifications|https://html.spec.whatwg.org/multipage/window-object.html>, L<StackOverlow about WindowProxy|https://stackoverflow.com/questions/16092835/windowproxy-and-window-objects>
1521              
1522             =head1 COPYRIGHT & LICENSE
1523              
1524             Copyright(c) 2021 DEGUEST Pte. Ltd.
1525              
1526             All rights reserved
1527              
1528             This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1529              
1530             =cut