EcmascriptDebugger5.0

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(BreakpointPosition)
{
}
returns (Default)
{
}
= 6;

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 (ObjectList)
{
}
= 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 all objects (that is, object received through this protocol as objectIDs), so they can be garbage collected by the ecmascript engine. Note that garbage collection is not necessarily run at this point, so the memory for the given objects might not be freed immediately. IMPORTANT: After this call, no object IDs received earlier are valid! All objects needs to be requested again.

command ReleaseObjects(Default)
{
}
returns (Default)
{
}
= 29;

RemoveBreakpoint

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

RemoveEventHandler

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

SetConfiguration

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

SpotlightObject

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

SpotlightObjects

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

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;

OnRuntimeStarted

event OnRuntimeStarted returns (RuntimeInfo)
{
}
= 14;

OnRuntimeStopped

event OnRuntimeStopped returns (RuntimeID)
{
}
= 15;

OnThreadFinished

event OnThreadFinished returns (ThreadResult)
{
}
= 18;

OnThreadStarted

event OnThreadStarted returns (ThreadInfo)
{
}
= 17;

OnThreadStoppedAt

event OnThreadStoppedAt returns (ThreadStopInfo)
{
}
= 19;