Properties:
Name | Type | Description |
---|---|---|
active |
bool | [readonly] Whether the document is currently active (the window and tab have focus). |
bbox |
object | [readonly] The current bounding box. |
bboxX |
number | [readonly] The document's bounding box X position in window coordinates. |
bboxY |
number | [readonly] The document's bounding box Y position in window coordinates. |
bboxWidth |
number | [readonly] The document's bounding box width in window coordinates. |
bboxHeight |
number | [readonly] The document's bounding box height in window coordinates. |
color |
string | The document's background color. |
contentHeight |
number | [readonly] The current scrolling viewport height. |
contentWidth |
number | [readonly] The current scrolling viewport width. |
contentX |
number | (default: |
contentY |
number | (default: |
fullscreenItem |
html.Item | (default: |
inputDevice |
string | [readonly] The currently active input device: mouse|touch|pen|keyboard |
maxHttpRequests |
number | (default: |
scrollbars |
bool | (default: |
systemDarkMode |
bool | [readonly] Whether the system is in dark mode (Windows 10, MacOS, Android). |
title |
string | The document's title. |
windowWidth |
number | [readonly] Deprecated: Use |
windowHeight |
number | [readonly] Deprecated: Use |
Extends
Methods
-
Creates and returns an asynchronous HTTP request with progress monitoring. The maximum number of simultaneous requests is determined by the property
maxHttpRequests
.Example
httpRequest("/path/to/resource") .send() .then(response => response.text()) .then(data => { console.log("Got data: " + data); }) .catch(err => { console.error(err); }
Example
httpRequest("/path/to/resource", "POST") .header("X-Custom-Header", "42") .body(new Blob(["Some data"])) .send(p => console.log("upload progress: " + p);
Example
httpRequest("/path/to/large.file") .send(null, p => console.log("download progress: " + p);
Name Type Description url
string The request URL.
method
string (default:
"GET"
) The HTTP method.Returns:
Type Description HttpRequest The request object. -
Returns whether the given box is (partially) within the viewport. The coordinates are in this element's local coordinate system.
Name Type Description x
number The X position to test.
y
number The Y position to test.
w
number The width to test.
h
number The height to test.
Type Definitions
-
A generic event.
Events
-
Is triggered when the browser context menu is requested. Binding to this event and accepting it prevents the default context menu from showing up.
Name Type Description event
html.Document.Event The event object.
-
Is triggered when a key is pressed while the document has keyboard focus.
Name Type Description event
html.Item.KeyboardEvent The event object.
-
Is triggered when a key is released while the item has keyboard focus.
Name Type Description event
html.Item.KeyboardEvent The event object.