new Window()
This Window object is created using by JSDOM, and attached the properties and the methods related to opening, closing, resizing and moving.
To open a new window, use Browser#newWindow or Browser#openWindow.
Properties:
| Name | Type | Description |
|---|---|---|
screen |
Screen | A Screen object. |
innerWidth |
number | The inner width of this window about the window edge. |
innerHeight |
number | The inner height of this window about the window edge. |
scrollX |
number | The horizontal scroll position of the page in this window. |
scrollY |
number | The vertical scroll position of the page in this window. |
pageXOffset |
number | The horizontal scroll position of the page in this window. |
pageYOffset |
number | The vertical scroll position of the page in this window. |
screenX |
number | The horizontal window position. |
screenY |
number | The vertical window position. |
outerWidth |
number | The full width of this window. |
outerHeight |
number | The full height of this window. |
devicePixelRatio |
number | The zooming ratio of the page in this window. |
closed |
boolean | The flag which is true if this window is closed. |
name |
string | The window name. |
Methods
-
close()
-
Closes this window.
Returns:
- Type
- Void
-
moveBy(dx, dy)
-
Moves this window by relative position from the current position of this window. This method is effective when this window is a popup.
Parameters:
Name Type Description dxnumber The horizontal moving size of this window.
dynumber The vertical moving size of this window.
Returns:
- Type
- Void
-
moveTo(x, y)
-
Moves this window position. This method is effective when this window is a popup.
Parameters:
Name Type Description xnumber The horizontal position of this window after moving.
ynumber The vertical position of this window after moving.
Returns:
- Type
- Void
-
open(url, target, features)
-
Opens a window which is indicated by
targetor a new window.In addition, loads the page content indicated by
urlifurlis not empty.Parameters:
Name Type Description urlstring An URL string of a page content.
targetstring A window name or a keyword which is either
_blank,_self,_parentor_top.featuresstring A set of comma separated strings which specify position, size and styles of a new window.
Returns:
A window which is created or selected.
- Type
- Window
-
resizeBy(dw, dh)
-
Resizes this window size by relative size from the current size of this window. This method is effective when this window is a popup.
Parameters:
Name Type Description dwnumber The resizing width of this window.
dhnumber The resizing height of this window.
Returns:
- Type
- Void
-
resizeTo(w, h)
-
Resizes this window size. This method is effective when this window is a popup.
Parameters:
Name Type Description wnumber The width of this window after resizing.
hnumber The height of this window after resizing.
Returns:
- Type
- Void
-
scroll(x, y)
-
Scrolls the page in this window.
Parameters:
Name Type Description xnumber The horizontal scroll position after scrolling.
ynumber The vertical scroll position after scrolling.
Returns:
- Type
- Void
-
scrollBy(dx, dy)
-
Scrolls the page in this window. The scroll size is relative position from the current scroll position.
Parameters:
Name Type Description dxnumber The horizontal scrolling size.
dynumber The vertical scrolling size.
Returns:
- Type
- Void
-
scrollTo(x, y)
-
Scrolls the page in this window.
Parameters:
Name Type Description xnumber The horizontal scroll position after scrolling.
ynumber The vertical scroll position after scrolling.
Returns:
- Type
- Void