Ecmascript1.0

back

Commands

Events

Provides access to functionality in the ECMAScript engine. Basic usage is to query the runtime list first, all commands require a runtime ID to work with.

All IDs in this service will be invalid once the service is disabled.

Note: For debugging of ECMAScript see the EcmascriptDebugger service.

Eval

Evaluate a piece of ECMAScript in the global scope. For instance to fetch information on the window object, one can do::

Eval(runtimeID=1, scriptData="window")

EvalResult.value.object will be set, note however that this will not include properties on the return object to conserve the amount of data that needs to be sent. To get properties use ExamineObjects().

command Eval(EvalArg)
{
}
returns (EvalResult)
{
}
= 2;

ExamineObjects

Request additional information about an object, such as its prototype or its properties.

For instance to get more information on the window object, one can do::

ExamineObjects(runtimeID=1, objectList=[2], examinePrototypes=true)

Here the object ID was the ID previously returned from an Eval() call.

command ExamineObjects(ExamineObjectsArg)
{
}
returns (ObjectList)
{
}
= 3;

ListRuntimes

List all runtimes (in all Windows). For instance to fetch all runtimes of all windows one can do::

ListRuntimes(runtimeList=[], create=true)

If you already have a runtime ID you can pass it in runtimeList to get get back information, e.g.::

ListRuntimes(runtimeList=[1])
command ListRuntimes(ListRuntimesArg)
{
}
returns (RuntimeList)
{
}
= 1;

ReleaseObjects

Release protected ECMAScript objects. This will just make them garbage collectible. Released objects are not necessarily freed immediately.

Calling ReleaseObjects with an empty list causes all objects to be released. Otherwise, only the specified objects will be released. Attempting to release a non-existent object has no effect, and will fail silently.

Releasing objects invalidates associated object IDs immediately.

command ReleaseObjects(ReleaseObjectsArg)
{
}
returns (Default)
{
}
= 4;

OnReadyStateChanged

Occurs when certain 'milestones' of page-loading have been reached. See message 'ReadyStateChange' for details.

event OnReadyStateChanged returns (ReadyStateChange)
{
}
= 5;