![]() |
v1.3.0.0
|
This reference contains a list of standard ECMAScript objects, functions and properties supported by the plugin's JavaScript engine.
The Dynamic Script Engine Plugin scripting environment supports most JavaScript features up to ECMAScript level 7 (ECMA-262), as well as a handful of "Web API" features, or their close approximations.
This document lists all the supported objects and methods from the standards, with further details about items which do not fully match what is published on MDN, which is used as a reference.
In some cases the standard objects are also extended (ArrayBuffer, Date, Math, Number, String, URL), as is the Global object, which is documented separately.
Nullish Coalescing (??
) and Optional Chaining (?.
) are also implemented.
Note that all Math
functions are also available in the global scope, w/out the Math.
qualifier.
(Note lack of support for BigInt types.)
at()
method)(Note lack of support for BigInt types.)
(Note that async functions/generators are not supported nor is the general async/await pattern. Use Promise instead.)
Any object type listed above but not here is presumed to have full compatibility as per MDN current documentation.
options
properties are extended). Since v1.3Supports all properties and methods described in MDN reference, except:
Supports all properties and methods described in MDN reference, except:
Supports all properties and methods described in MDN reference, except:
Note that in addition to the onabort
property, there are other methods for connecting to the signal's abort
event. signal.on("abort", callback)
, for example, which takes an optional, 3rd argument after the callback. If an object is passed here then the callback function will be invoked with that object as the this
target. For example:
Alternately, the abort
event can be safely connect
ed directly to a method of any object. For example:
See Event Handling for more details about connecting handlers to events.
setTimeout()
/clearTimeout()
and setInterval()
/clearInterval()
, are fully implemented as per standard (MDN reference), with some notes.setTimeout()
and setInterval()
do accept optional arguments after the delay parameter, which are passed through to the function being invoked .setTimeout()
and setInterval()
also accept an extended form of the first parameter, which is usually the function to invoke or string to evaluate. Instead, the first parameter can be an array with two values; the first value is the function to invoke and the second is the this
scope object for calling the function with. This can avoid using an inline function in cases where this
scope would typically be lost.clearAllTimers()
and clearInstanceTimers()
console.log()
- same as console.debug()console.debug()
console.info()
console.warn()
console.error()
console.assert()
console.time()
console.timeEnd()
console.trace()
console.count()
console.profile()
console.profileEnd()
console.dir(obj [,options])
- logs an object's properties, with recursion. Uses inspect()
to get the output to print. Equivalent to console.debug(inspect(obj, options))
. See inspect()
for options
details.Extended functionality:
console.exception()
- like console.error()
but also prints stack trace.print()
- same as console.log()printf(format, ...args)
- writes formatted strings to the console log at "debug" level. Equivalent to console.log(sprintf(format, ...args))
. See sprintf()
for details.console.logf(format, ...args)
, console.debugf(format, ...args)
, console.printf(format, ...args)
- same as printf()
console.infof(format, ...args)
- writes formatted string to console at "info" level. Equivalent to console.info(sprintf(format, ...args))
.console.warnf(format, ...args)
- writes formatted string to console at "warning" level. Equivalent to console.warn(sprintf(format, ...args))
.console.errorf(format, ...args)
- writes formatted string to console at "error" level. Equivalent to console.error(sprintf(format, ...args))
.The XMLHttpRequest object, which can be used to obtain data over a network using HTTP/s protocols.
The XMLHttpRequest API implements the same W3C standard as many popular web browsers with following exceptions:
redirect
property has been added to control redirection response behavior. The options are similar to the standard Fetch API redirect
option with some additions:follow
: Automatically follow redirects. Unless otherwise stated the redirect mode is set to follow.error
: Abort with an error if a redirect occurs.manual
: Caller intends to process the response in another context.no-less-safe
: Only allow http -> http, http -> https, and https -> https redirects (do not follow https -> http redirect); This is the default.same-origin
: Only follow redirect if the original scheme, host, and port match.requestJSON
property has been added, as a counterpart to the standard responseText
and responseXML
properties. This is equivalent to xhr.responseType = "json"; var obj = xhr.response;
requestBuffer
property has also been added. This is equivalent to xhr.responseType = "arraybuffer"; var arrayBuffer = xhr.response;
open()
command, in which case open()
can be called with no parameters. Or for example the URL can be set first, then open(method)
called later.
headers
property is added; This returns a two-dimensional array of header name/value pairs. For example: send()
method is called, this contains any headers explicitly added by the user with setRequestHeader()
.send()
and once the request has resolved, this will contain the response headers. These are the same headers obtained with getAllResponseHeaders()
but in a structured format, possibly including duplicates as per HTTP spec (they are not merged as they would be with getAllResponseHeaders()
).Additionally, the responseXML
XML DOM tree currently supported by DSEP4TP is a reduced subset of the DOM Level 3 Core API supported in a web browser. The following objects and properties are supported:
Node | Document | Element | Attr | CharacterData | Text |
---|---|---|---|---|---|
|
|
|
|
|
|