EcmascriptDebugger6.10

back

Commands

Events

Central data types and how they work:

A "runtime" represents a document context in which threads execute. There is a one-to-one mapping between runtimes and HTML documents.

A "thread" represents a thread of execution in a runtime. A "parent" thread can be preempted by another "child" thread in order to respond to a priority event; the parent thread will not run again until the child thread has finished.

A "script" is a pair (id, source code) where the id is globally unique and the source code is Unicode text.

An "object" is represented by a globally unique ID that is assigned by the debugger.

Globally unique means unique within a running Opera session; that is from starting Opera to stopping it.

The windowID is shared across scope. Notably, it's the same as in the console logger and window manager INTERNAL: The value is from Window::id

AddBreakpoint

command AddBreakpoint(Breakpoint)
{
}
returns (Default)
{
}
= 6;

AddEventBreakpoint

command AddEventBreakpoint(EventBreakpoint)
{
}
returns (Default)
{
}
= 38;

AddEventHandler

Add an event handler. This will generate a OnHandleEvent event every time the XML event defined by the pair (namespace, eventType) reaches the object defined by objectID in the capturing phase. XML events are defined in http://www.w3.org/TR/xml-events

command AddEventHandler(EventHandler)
{
}
returns (Default)
{
}
= 8;

Break

command Break(BreakSelection)
{
}
returns (Default)
{
}
= 12;

ContinueThread

command ContinueThread(ThreadMode)
{
}
returns (Default)
{
}
= 2;

CssGetAllStylesheets

command CssGetAllStylesheets(RuntimeID)
{
}
returns (CssStylesheetList)
{
}
= 23;

CssGetIndexMap

command CssGetIndexMap(Default)
{
}
returns (CssIndexMap)
{
}
= 22;

CssGetStyleDeclarations

command CssGetStyleDeclarations(CssElementSelection)
{
}
returns (CssStyleDeclarations)
{
}
= 25;

CssGetStylesheet

command CssGetStylesheet(CssStylesheetSelection)
{
}
returns (CssStylesheetRules)
{
}
= 24;

Eval

command Eval(EvalData)
{
}
returns (EvalResult)
{
}
= 3;

ExamineObjects

command ExamineObjects(ExamineList)
{
}
returns (ObjectChainList)
{
}
= 4;

GetBacktrace

command GetBacktrace(BacktraceSelection)
{
}
returns (BacktraceFrameList)
{
}
= 11;

GetSelectedObject

command GetSelectedObject(Default)
{
}
returns (ObjectSelection)
{
}
= 26;

InspectDom

command InspectDom(DomTraversal)
{
}
returns (NodeList)
{
}
= 13;

ListRuntimes

command ListRuntimes(RuntimeSelection)
{
}
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)
{
}
= 29;

RemoveBreakpoint

command RemoveBreakpoint(BreakpointID)
{
}
returns (Default)
{
}
= 7;

RemoveEventHandler

command RemoveEventHandler(EventHandlerID)
{
}
returns (Default)
{
}
= 9;

SearchDom

Search the DOM of a document, using either plain text, regexp, xpath or CSS selectors.

For plain text and regular expression searches, tag names, attribute names, attribute values and text content is searched through. Regular expressions searches use the same backend as the RegExp object in ECMAScript, and therefore use the same syntax and semantics.

CSS selector or XPath searches work like their DOM counterparts (document.querySelector, and document.evaluate). For more information, see:

Whenever a matching node is found, that node is included in the command response, and marked as a search hit. The parent chain is also included for each hit; however, no parent is included twice (nor is any 'hit' included twice).

Added in version 6.5

command SearchDom(SearchDomArg)
{
}
returns (NodeList)
{
}
= 42;

SetConfiguration

command SetConfiguration(Configuration)
{
}
returns (Default)
{
}
= 10;

SetFunctionFilter

Specify which objects to get OnFunctionCallStarting and OnFunctionCallCompleted events for. If a function is called on an object with a matching class name, the events will be reported.

The default filter is empty, meaning no function calls will be reported.

Added in version 6.4

command SetFunctionFilter(FunctionFilter)
{
}
returns (Default)
{
}
= 39;

SetPropertyFilter

Sets a new property filter which may hide some properties when examining an object. This is useful for excluding many 'uninteresting' properties found on built-in prototypes.

Calling this will overwrite the previous filter.

command SetPropertyFilter(SetPropertyFilterArg)
{
}
returns (Default)
{
}
= 30;

SpotlightObject

command SpotlightObject(SpotlightObjectSelection)
{
}
returns (Default)
{
}
= 5;

SpotlightObjects

command SpotlightObjects(SpotlightSelection)
{
}
returns (Default)
{
}
= 27;

OnConsoleLog

This event occurs when the script calls one of these functions:

1. console.log 2. console.debug 3. console.info 4. console.warn 5. console.error 6. console.assert 7. console.dir 8. console.dirxml 9. console.group 10. console.groupCollapsed 11. console.groupEnded 12. console.count 13. console.table

All the functions behave the same way; they accept any number of arguments, and sends them to the client.

The console.assert function is a special case, which outputs nothing if the first argument evaluates to true. Otherwise, it behaves like the other functions and sends its arguments to the client (including the first argument which triggered the assertion). If the assertion fails, it also throws an exception.

event OnConsoleLog returns (ConsoleLogInfo)
{
}
= 32;

OnConsoleProfile

Occurs when console.profile is called in a script. Note that profiling is not yet supported. This event is just included to let the client know that the function has been called.

event OnConsoleProfile returns (ConsoleProfileInfo)
{
}
= 36;

OnConsoleProfileEnd

Occurs when console.profileEdd is called in a script. Note that profiling is not yet supported. This event is just included to let the client know that the function has been called.

event OnConsoleProfileEnd returns (ConsoleProfileEndInfo)
{
}
= 37;

OnConsoleTime

Occurs when console.time is called in the script. When this event occurs, Opera will start a timer which can be referred to by the specified title. The timer can later be stopped with console.timeEnd, which will calculate the elapsed time between the two calls.

event OnConsoleTime returns (ConsoleTimeInfo)
{
}
= 33;

OnConsoleTimeEnd

Occurs when console.timeEnd is called in the script. The message contains the elapsed time between the corresponding call to console.time (see OnConsoleTime).

event OnConsoleTimeEnd returns (ConsoleTimeEndInfo)
{
}
= 34;

OnConsoleTrace

Occurs when console.trace is called in the script. Sends the stack trace at the position where the call was made.

event OnConsoleTrace returns (ConsoleTraceInfo)
{
}
= 35;

OnFunctionCallCompleted

Occurs when a function call has completed.

event OnFunctionCallCompleted returns (FunctionCallCompletedInfo)
{
}
= 41;

OnFunctionCallStarting

Occurs when a function call is about to be performed.

event OnFunctionCallStarting returns (FunctionCallStartingInfo)
{
}
= 40;

OnHandleEvent

This event is issued for XML events on the host, if a corresponding AddEventHandler has been issued earlier by the client.

event OnHandleEvent returns (DomEvent)
{
}
= 20;

OnNewScript

event OnNewScript returns (ScriptInfo)
{
}
= 16;

OnObjectSelected

Some hosts send this event to indicate that an object was selected for debugging, e.g., if the debugger was started by right-clicking an element and clicking "inspect" in the context menu, this event will be sent right after startup. A client may safely choose to ignore this event.

event OnObjectSelected returns (ObjectSelection)
{
}
= 21;

OnParseError

event OnParseError returns (DomParseError)
{
}
= 28;

OnReadyStateChanged

Sent when the ready state of a document is changed. The possible states are:

1. DOMContentLoaded: When the DOM (not inline elements) is loaded 2. Loaded: After all onload-handlers have finished
event OnReadyStateChanged returns (ReadyStateInfo)
{
}
= 31;

OnRuntimeStarted

event OnRuntimeStarted returns (RuntimeInfo)
{
}
= 14;

OnRuntimeStopped

event OnRuntimeStopped returns (RuntimeID)
{
}
= 15;

OnThreadFinished

event OnThreadFinished returns (ThreadResult)
{
}
= 18;

OnThreadMigrated

Occurs when a thread migrates from one runtime to another runtime. This can happen if 'document.write' replaces the current runtime.

Added in version 6.9

event OnThreadMigrated returns (ThreadMigration)
{
}
= 43;

OnThreadStarted

event OnThreadStarted returns (ThreadInfo)
{
}
= 17;

OnThreadStoppedAt

event OnThreadStoppedAt returns (ThreadStopInfo)
{
}
= 19;