Crossfire 0.3a7 Protocol Reference

From FirebugWiki

Jump to: navigation, search

Contents

[edit] Handshake

Once a connection has been established with a remote host, Crossfire will wait until it receives a UTF-8 string which matches CrossfireHandshake\r\n\r\n

If crossfire was started as a server it will reply with an acknowledgement that matches CrossfireHandshake\r\n\r\n.

The handshake can also be modified to include the names of tools that should be enabled when the server starts. More information about tool support and how to enabled / disable them can be found on the Tools API page.

[edit] Packet Format

Crossfire packets contain a content-length header with key Content-Length followed by a colon (:), and the number of characters (in decimal) contained in the message body.

The body of the packet is a UTF-8 string containing a JSON-formatted message. Message bodies contain, at a minimum, the context ID, sequence number and packet type.

contextId 
string that identifies which JavaScript context the packet applies to.
seq 
the packet sequence number (integer)
type 
the type of the packet - one of "request","response", or "event"

Packet headers and body are separated by a double CRLF (\r\n\r\n). Packets are terminated by a CRLF (\r\n) after the body.

Example:

Content-Length:69
\r\n\r\n
{
  "contextId":null,
  "type":"request",
  "seq":1,
  "command":"listcontexts"
}\r\n

[edit] Request Packets

A request packet includes a command name and an arguments object containing any arguments specific to the command.
All request packets have the general form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":<command>,
  "contextId":<context_id> 
  "seq":<packet_sequence>,
  "arguments":{<argument_list>}
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
command the name of the request. A complete listing of requests that can be used in <command> are available in the Commands section.
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
arguments_list the list of arguments to pass in with the request

Example:

Content-Length:219
\r\n\r\n
{
  "type":"request",
  "command":"setbreakpoint",
  "contextId":"http://localhost:8080/test.html",
  "seq":21,
  "arguments": { 
                 "position":0,
                 "enabled":true,
                 "target":"http://localhost:8080/test/some_javascript.js",
                 "line":9,
                 "ignoreCount":0,
                 "type":"line"
               }
}
\r\n

[edit] Response Packets

A response packet will contain the sequence number of the original request and the name of the command, as well as the body of the response and booleans indicating the running status and whether the request was successful.
All response packets are of the form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"response",
  "command":<command>,
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "request_seq":<request_sequence>,
  "body":<body_object>,
  "running":<is_running>,
  "success":<success_status>,
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
command the name of the original request
context_id the id of the context this response came from
packet_sequence the packet sequence number
request_sequence the request sequence number
body_object JSON object containing additional data about the response
running if Crossfire is in a running state
success if the request was successful or not

Example:

Content-Length:80
\r\n\r\n
{
  "type":"response",
  "command":"listcontexts",
  "contextId":"xf0.1a::9931113",
  "seq":2,
  "request_seq":1,
  "running":true,
  "success":true,
  "body":{
           "contexts":["http://localhost:8080/test.html"]
         }
}
\r\n

[edit] Event Packets

Event packets contain the name of the event and a 'data' object which may contain more information related to the event.
All event packets are of the form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"event",
  "event":<event>,
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "data":{<data_object>}
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
event the name of the event. A complete listing of events that can appear in <event> are available in the Events section.
context_id the id of the context this event came from
packet_sequence the packet sequence number
data_object JSON object containing additional data about the event

Example

Content-Length:122
\r\n\r\n
{
  "type":"event",
  "event":"onContextCreated",
  "contextId":"xf0.1a::9931113",
  "seq":5,
  "data":{
           "href":"http://www.google.ca/"
         }
}

[edit] Types

Commands like frame, backtrace, scope, lookup will contain serialized Javascript values and objects in the body of the response. The JSON structure for these objects will always contain a type field, and either a value field with a JSON value or, in the case of object or function types, a handle field which can be used to obtain the actual value by using the lookup command.

[edit] object

An object is represented as a handle of the form:
{
  "myobject":{
               "type":"object",
               "handle":<number>
             }
}

Objects can also be nested within other objects. For example in the case of backtrace request, you will receive a response with variables split up as locals and 'this'.

Nested objects will always appear as a value entry in the object, like the following:

{
  "myobject":{
               "type":"object",
               "value":{
                         "mynestedobj":{"type":"object","handle":<number>}
                       }
             }
}

[edit] function

A function is represented as a handle of the form:
{
  "myfunction":{
                 "type":"function",
                 "handle":<number>
               }
}

In versions of Crossfire less than 0.3a2 a function was represented as:

{
  "myfunction":{
                 "type":"function",
                 "value":"function()"
               }
}

[edit] boolean

A boolean is represented as:
{
  "myboolean":{
                "type":"boolean",
                "value":<true_or_false>
              }
}

[edit] number

A number is represented as:
p
{
  "mynumber":{
               "type":"number",
               "value":<number>
             }
}

[edit] string

A string is represented as:
{
  "mystring":{
               "type":"string",
               "value":"string_value"
             }
}

[edit] undefined

An undefined value is represented as:
{
  "myfunction":"undefined"
}

[edit] null

A null value is represented as:
{
  "mystring":null
}

[edit] Objects

[edit] breakpoint

A breakpoint object describes a single breakpoint from Crossfire.
This object can be found in the changebreakpoint, getbreakpoint, getbreakpoints and setbreakpoint responses as well as the onToggleBreakpoint event.
{
  "handle":<handle>,
  "type":<type>,
  "location":<location>,
  "attributes":<attributes>
}

Values

handle the Crossfire identifier for this breakpoint object
type the type of the breakpoint - for example line or error
location the object that contains location information
attributes the object of attributes that describe the breakpoint - for example enabled or condition

[edit] context

A context object describes a given context (tab) in Crossfire.
This object can be found in the listcontexts response.
{
  "contextId":<context_id>,
  "url":<url>,
  "current":<is_current>
}

Values

context_id the id of the context
url the URL opened in the context (tab)
is_current if the context is the focus context

[edit] frame

A frame object describes a single stackframe from the debugger.
This object can be found in the backtrace and frame responses.
{
  "index":<index>,
  "line":<line_number>,
  "functionName":<func_name>,
  "url":<url>,
  "locals":<variable_objects>,
  "scopes":<scope_array>
}

Values

index the index of the frame within the complete stack of frames from the debugger
line_number the line number the frame is currently suspended on
functionName the name of the function the frame is currently suspended in
url the URL of the script the frame is suspended in
locals the object containing the group of local variables for the frame
scopes the array of scope objects

[edit] scope

A scope object represents a logical grouping for a given set of local variables.
This object can be found in a stack frame object and in the scope and scopes responses.
{
  "index": <index>,
  "frameIndex": <frame_index>,
  "scope": <scope_object>
}

Values

index the index of the scope in the complete array of scopes
frame_index the index of the frame this scope aligns with
closing_object the serialized object handle of the object that makes up this scope

[edit] script

A script object describes a single script.
This object can be found in the script, scripts and source responses as well as in the onScript event.
{
  "url":<url>,
  "lineOffset":<line_offset>,
  "columnOffset":<column_offset>,
  "sourceLength":<source_length>,
  "lineCount":<line_count>,
  "type":<type>,
  "source":<source>
}

Values

url the URL of the script
line_offset the current line offset of the script within its parent (if any)
column_offset the current column offset of the script within its parent (if any)
source_length the entire length of the source for the script including all control characters
line_count the number of lines in the script
type the type of the compilation unit - see sourceFile.js for complete listing of types
source the complete source of the script

[edit] tool

A tool object describes a default or contributed tool.
This object can be found in the gettools, enabletools and disabletools responses.
{
  "name":<name>,
  "enabled":<enabled_state>,
  "commands":<command_array>,
  "events":<event_array>,
  "desc":<description>
}

Values

name the name of the tool
enabled_state the enabled state of the tool (true or false)
command_array the array of the names of the commands this tool supports
event_array the array of the names of the events this tool is capable of sending
description the human-readable description of the tool

[edit] Commands

[edit] backtrace

Returns a backtrace (stacktrace) of frames.
The request packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":"backtrace",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "arguments":{
                "fromFrame":<from_frame>,
                "toFrame":<to_frame>,
                "includeScopes":<include_scopes>
              }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
from_frame an optional argument that indicates what frame to start the backtrace from. If not specified, zero is assumed.
to_frame an optional argument that indicates what frame to end the backtrace at. If not specified or larger than the total frame count, the total frame count is assumed.
include_scopes an optional argument that indicates that the scopes for the frames should also be returned in the response. If not specified true is assumed.

Example Request

An example of the request you send:

Content-Length:128
\r\n
{
  "type":"request",
  "command":"backtrace",
  "contextId":"xf0.1a::9931113",
  "seq":6,
  "arguments":{
                "fromFrame":0,
                "includeScopes":true
              }
}
\r\n

The response packet has the following form:

Content-Length:<content_length>
\r\n\r\n
{
  "type":"response",
  "command":"backtrace",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "request_seq":<request_sequence>,
  "body": {
            "fromFrame":<from_frame>,
            "toFrame":<to_frame>,
	    "frames":<frame_array>,
           },
  "running":<running>,
  "success":<success>
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
request_sequence the packet request sequence number
from_frame the number of the frame the backtrace starts from
to_frame the number of the frame the backtrace ends at
frame_array the array of frame objects
running if Crossfire is in a running state
success if the request was successful or not

Example Response

An example of the response you receive:

Content-Length:6325
\r\n\r\n
{
  "type":"response",
  "command":"backtrace",
  "contextId":"xf0.3::4303985",
  "seq":50,
  "request_seq":49,
  "body": {
            "fromFrame":0,
            "toFrame":1,
	    "frames":[{
                        "index":0,
                        "func":"onload",
                        "script":"http://www.google.ca//event/seq/1",
                        "locals":{"type":"object", "value":{}},
                        "line":2,
                        "scopes":[{"index":0,"frameIndex":0,"object":{"type":"object","handle":348}}]
                      }],
           },
  "running":false,
  "success":true
}

[edit] changebreakpoint

Changes the attributes of the breakpoint with the given handle to the given set of attributes.
This command has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
The form of the request packet is:
Content-Length:<content_length>
\r\n\r\n
{
 "type":"request",
  "command":"changebreakpoint",
  "seq":<packet_sequence>,
  "arguments":{
                "handle":<handle>
                "attributes":<attributes_object>
              }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number
handle a required argument that specifies the handle of the breakpoint to change
attributes_object an optional object argument that specifies the attributes to set or update on the breakpoint

Example Request

An example of the request you send:

Content-Length:151
\r\n\r\n
{
  "type":"request",
  "command":"changebreakpoint",
  "seq":16,
  "arguments":{
                "handle":1,
                "attributes":{
                               "enabled":false,
                               "condition":"typeof(foo) == undefined"
                             }
              },
}
\r\n

The response packet has the following form:

Content-Length:<content_length>
\r\n\r\n
{
  "type":"response",
  "command":"changebreakpoint",
  "seq":<packet_sequence>,
  "request_seq":<request_sequence>,
  "body":{<breakpoint_object>},
  "running":<is_running>,
  "success":<success_status>,
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number
request_sequence the request sequence number
breakpoint_object the breakpoint object that was changed
running if Crossfire is in a running state
success if the request was successful or not

Example Response

An example of the response you receive:

Content-Length:272
\r\n\r\n
{
  "type":"response",
  "command":"changebreakpoint",
  "seq":26,
  "request_seq":23,
  "body":{
           "handle":4,
           "type":"line",
           "location":{
                        "url":"http://www.google.ca/",
                        "line":2
                      },
           "attributes":{
                          "enabled":true,
                          "condition":null
                        }
         },
  "running":true,
  "success":true
}

[edit] continue

Continue execution of javascript if suspended, if no stepaction is passed, simply resumes execution.
This command has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
The form of the packet is:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":"continue",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "arguments":{
     "stepAction":[in, next, out]
  }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
stepAction an optional argument in crossfire 0.3 and greater, required for 0.2a* and lower. The value can be one of in, next, or out. Passing in an unknown kind of stepAction will result in the context being resumed with no step performed.

Example Request

An example of the request you send:

Content-Length:78
\r\n\r\n
{
  "type":"request",
  "command":"continue",
  "contextId":"xf0.3::2777681",
  "seq":87
}
\r\n

Example Response

An example of the response you receive:

Content-Length:105
\r\n\r\n
{
  "type":"response",
  "command":"continue",
  "seq":8,
  "request_seq":7,
  "running":false,
  "success":true
}

[edit] createcontext

Load a new URL into an existing context. If no context is specified, opens a new tab and loads the given URL.
This command has been added in Crossfire version 0.3a7, please see the migration guide entry for more information.
The packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":"createcontext",
  "seq":<packet_sequence>
  "arguments": {
                 "url": <url>
                 "contextId":<context_id>
               }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
url A required URL to load
context_id An optional context id to open the new URL in

Example Request

An example of the request you send:

Content-Length:47
\r\n\r\n
{
  "type":"request"
  "command":"createcontext",
  "seq": 22,
  "arguments": {
                 "contextId":"xf0.1a::9931113",
                 "url": "http://collinsmichaelg.com"
               }
}
\r\n

Example Response

An example of the response you will receive:

Content-Length:120
\r\n\r\n
{
  "type":"response",
  "command":"createcontext",
  "seq":23,
  "request_seq":22,
  "body":{},
  "running":true,
  "success":true
}

[edit] deletebreakpoint

Remove the breakpoint object with the specified id.
This command has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
The request packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
 "type":"request"
  "command":"deletebreakpoint",
  "seq":<packet_sequence>,
  "arguments":{
                "handle":<handle>,
              }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number
handle a required argument that specifies the handle of the breakpoint to clear

Example Request

An example of the request you send:

Content-Length:81
\r\n\r\n
{
  "type":"request",
  "command":"deletebreakpoint",
  "seq":13,
  "arguments":{
                "handle":1
              }
}
\r\n

The response packet has the following form:

Content-Length:<content_length>
\r\n\r\n
{
  "type":"response",
  "command":"deletebreakpoint",
  "seq":<packet_sequence>,
  "request_seq":<request_sequence>,
  "body":{<breakpoint_object>},
  "running":<is_running>,
  "success":<success_status>,
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number
request_sequence the request sequence number
breakpoint_object the breakpoint object that was deleted
running if Crossfire is in a running state
success if the request was successful or not

Example Response

An example of the response you receive:

Content-Length:232
\r\n\r\n
{
  "type":"response",
  "command":"deletebreakpoint",
  "seq":15,
  "request_seq":13,
  "body":{
           "handle":4,
           "type":"line",
           "location":{
                        "url":"http://www.google.ca/",
                        "line":2
                      },
           "attributes":{
                          "enabled":true,
                          "condition":null
                        }
         },
  "running":true,
  "success":true
}

[edit] disabletools

Allows one or more known tools to be disabled.
The packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":"disabletools",
  "seq":<packet_sequence>,
  "arguments":{
                "tools":<tool_names>
              }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number
tool_names a required list argument that provides the names of the tools to be enabled

Example Request

An example of the request you send:

Content-Length:84
\r\n\r\n
{
  "type":"request",
  "command":"disabletools",
  "seq":4,
  "arguments":{
                "tools":["console"]
              }
}
\r\n

Example Response

An example of the response you receive:

Content-Length:809
\r\n\r\n
{
  "type":"response",
  "command":"disabletools",
  "seq":5,
  "request_seq":4,
  "body":{
          "tools":[
                   {
                     "name":"console",
                     "enabled":false,
                     "commands":["setloglevel","setloglimit"],
                     "events":["onConsoleLog","onConsoleDebug","onConsoleInfo","onConsoleWarn","onConsoleError"],
                     "desc":"console is a tool with an unimplemented getDescription() method."
                   },
                   ...
                   ]
         },
 "running":true,
 "success":true
}

[edit] enabletools

Allows one or more known tools to be enabled.
The packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":"enabletools",
  "seq":<packet_sequence>,
  "arguments":{
                "tools":<tool_names>
              }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number
tool_names a required list argument that provides the names of the tools to be enabled

Example Request

An example of the request you send:

Content-Length:84
\r\n\r\n
{
  "type":"request",
  "command":"enabletools",
  "seq":4,
  "arguments":{
                "tools":["console"]
              }
}
\r\n

Example Response

An example of the response you receive:

Content-Length:809
\r\n\r\n
{
  "type":"response",
  "command":"enabletools",
  "seq":5,
  "request_seq":4,
  "body":{
          "tools":[
                   {
                     "name":"console",
                     "enabled":true,
                     "commands":["setloglevel","setloglimit"],
                     "events":["onConsoleLog","onConsoleDebug","onConsoleInfo","onConsoleWarn","onConsoleError"],
                     "desc":"console is a tool with an unimplemented getDescription() method."
                   },
                   ...
                   ]
         },
 "running":true,
 "success":true
}

[edit] evaluate

Evaluates a JavaScript expression, either in the global scope, or optionally in a given frame if it exists.
This command has been added in Crossfire version 0.3a7, please see the migration guide entry for more information
The form of the packet is:
Content-Length:<content_length>
\r\n\r\n
{
  "command":"evaluate",
  "type":"request",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "arguments":{
                "expression":<expression>,
                "frameIndex":<frame>
              }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
expression a required argument that specifies the expression to evaluate
frameIndex an optional argument that specifies the index of the stackframe to perform the evaluation on, where zero is the top stack frame. If omitted zero is assumed.

Example Request

An example of the request you send:

Content-Length:123
\r\n\r\n
{
  "command":"evaluate",
  "type":"request",
  "contextId":"xf0.3::3442767",
  "seq":20,
  "arguments":{
                "expression":"2*4-1",
                "frameIndex":0
              }
}
\r\n

Example Response

An example of the response you receive:

Content-Length:177
\r\n\r\n
{
  "command":"evaluate",
  "type":"response",
  "contextId":"xf0.3::3442767",
  "seq":21,
  "request_seq":20,
  "running":false,
  "success":true,
  "body":{
           "result":{
                      "type":"number",
                      "value":7
                    }
         }
}

[edit] frame

Returns a frame.
This command has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
The request packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":"frame",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "arguments":{
                "index":<frame>,
                "includeScopes":<include_scopes>
              }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
index a required argument that specifies the index of the frame to look up
include_scopes an optional argument that indicates that the scopes for the frames should also be returned in the response.

Example Request

An example of the request you send:

Content-Length:120
\r\n\r\n
{
  "type":"request",
  "command":"frame",
  "contextId":"xf0.3::7322351",
  "seq":33,
  "arguments":{
                "index":0,
                "includeScopes":true
              },
}
\r\n

The response packet has the following form:

Content-Length:<content_length>
\r\n\r\n
{
  "type":"response",
  "command":"frame",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "request_seq":<request_sequence>,
  "body": {
           <frame_object> 
           },
  "running":<running>,
  "success":<success>
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
request_sequence the packet request sequence number
frame_object the frame object
running if Crossfire is in a running state
success if the request was successful or not

Example Response

An example of the response you receive:

Content-Length:6764
\r\n\r\n
{
  "type":"response",
  "command":"frame",
  "contextId":"xf0.3::7322351",
  "seq":34,
  "request_seq":33,
  "body":{
           "index":0,
           "line":19,
           "func":"anonymous",
           "script":"http://www.mozilla.com/js/jquery/jquery.min.js",
           "locals":{"type":"object","value":{},"this":{"type":"object","value":{"classList":{"type":"object","handle":13}}}},
           "scopes":[{"index":0,"frameIndex":0,"object":{"type":"object","handle":"14"}}]
         },
  "running":false,
  "success":true
}

[edit] getbreakpoint

Return the breakpoint object with the specified id.
This command has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
The request packet has he following form:
Content-Length:<content_length>
\r\n\r\n
{
 "type":"request",
  "command":"getbreakpoint",
  "seq":<packet_sequence>,
  "arguments":{
                "handle":<breakpoint>
              }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number
handle a required argument that specifies the handle of the breakpoint to look up

Example Request

An example of the request you send:

Content-Length:112
\r\n\r\n
{
  "type":"request",
  "command":"getbreakpoint",
  "seq":16,
  "arguments":{
                "handle":1
              }
}
\r\n

The response packet has the following form:

Content-Length:<content_length>
\r\n\r\n
{
  "type":"response",
  "command":"getbreakpoint",
  "seq":<packet_sequence>,
  "request_seq":<request_sequence>,
  "body": {
           "breakpoint":<breakpoint_object>
          },
  "running":<is_running>,
  "success":<success_status>,
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number
request_sequence the request sequence number
breakpoint_object the breakpoint object
running if Crossfire is in a running state
success if the request was successful or not

Example Response

An example of the response you receive:

Content-Length:265
\r\n\r\n
{
  "type":"response",
  "command":"getbreakpoint",
  "seq":45,
  "request_seq":44,
  "body":{
           "breakpoint":{
                          "handle":1,
                          "type":"line",
                          "location":{
                                       "line":2,
                                       "url":"http://www.google.ca//event/seq/1"
                                     },
                          "attributes":{
                                         "enabled":true,
                                         "condition":null
                                       }
                        }
        },
  "running":true,
  "success":true
}

[edit] getbreakpoints

Return all the breakpoints in this context.
This command has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
The request packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":"getbreakpoints",
  "seq":<packet_sequence>,
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number

Example Request

An example of the request you send:

Content-Length:84
\r\n\r\n
{
 "type":"request",
 "command":"getbreakpoints",
 "seq":12,
}
\r\n

The response packet has the following form:

Content-Length:<content_length>
\r\n\r\n
{
  "type":"response",
  "command":"getbreakpoints",
  "seq":<packet_sequence>,
  "request_seq":<request_sequence>,
  "body":<breakpoint_array>,
  "running":<is_running>,
  "success":<success_status>,
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number
request_sequence the request sequence number
breakpoint_array array of breakpoint objects
running if Crossfire is in a running state
success if the request was successful or not

Example Response

An example of the response you receive:

Content-Length:265
\r\n\r\n
{
  "type":"response",
  "command":"getbreakpoints",
  "seq":45,
  "request_seq":44,
  "body":{
           "breakpoints":[{
                            "handle":1,
                            "type":"line",
                            "location":{
                                         "line":2,
                                         "url":"http://www.google.ca//event/seq/1"
                                       },
                            "attributes":{
                                           "enabled":true,
                                           "condition":null
                                         }
                         }]
          },
  "running":true,
  "success":true
}

[edit] gettools

Returns the complete collection of registered tools.
The packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":"gettools",
  "seq":<packet_sequence>
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number

Example Request

An example of the request you send:

Content-Length:48
\r\n\r\n
{
  "type":"request",
  "command":"gettools",
  "seq":10
}
\r\n

Example Response

An example of the response you receive:

Content-Length:809
\r\n\r\n
{
  "type":"response",
  "command":"gettools",
  "seq":5,
  "request_seq":4,
  "body":{
          "tools":[
                   {
                     "name":"console",
                     "enabled":true,
                     "commands":["setloglevel","setloglimit"],
                     "events":["onConsoleLog","onConsoleDebug","onConsoleInfo","onConsoleWarn","onConsoleError"],
                     "desc":"console is a tool with an unimplemented getDescription() method."
                   },
                   ...
                   ]
         },
 "running":true,
 "success":true
}


[edit] inspect

Tells Firebug to enter 'inspect' mode on the given node.
The form of the packet is:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":"inspect",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "arguments":{
                "xpath":<xpath>
                "selector":<selector>
              }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
xpath an optional argument specifying the xpath to the node to inspect.
selector an optional argument specifying the selector of the node to inspect

One of xpath or selector must be specified. If both are specified, xpath is used.

Example Request

An example of the request you send:

Content-Length:128
\r\n\r\n
{
  "type":"request",
  "command":"inspect",
  "contextId":"xf0.3::815372",
  "seq":51,
  "arguments":{
                "xpath":"/html[1]/body[1]/span[1]"
              }
}
\r\n

Example Response

An example of the response you receive:

Content-Length:307
\r\n\r\n
{
  "type":"response",
  "command":"inspect",
  "seq":53,
  "request_seq":51,
  "body":{
           "xpath":"/html[1]/body[1]/span[1]",
          },
  "running":false,
  "success":true
}

[edit] listcontexts

Returns a list of context id's. This command does not require a contextId field.
This command has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
The request packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":"listcontexts",
  "seq":<packet_sequence>
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number

Example Request

An example of the request you send:

Content-Length:51
\r\n\r\n
{
  "type":"request",
  "command":"listcontexts",
  "seq":8
}
\r\n

The response packet has the following form:

Content-Length:<content_length>
\r\n\r\n
{
  "type":"response",
  "command":"listcontexts",
  "seq":<packet_sequence>,
  "request_seq":<request_sequence>,
  "body":{
           "contexts":<contexts_array>
         },
  "running":<is_running>,
  "success":<success_status>,
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number
request_sequence the request sequence number
body_object JSON object containing additional data about the response
contexts_array array of context objects
running if Crossfire is in a running state
success if the request was successful or not

Example Response

An example of the response you receive:

Content-Length:196
\r\n\r\n
{
  "type":"response",
  "command":"listcontexts",
  "seq":6,
  "request_seq":5,
  "body":{
           "contexts":[{"contextId":"xf0.3::5482594","url":"http://www.google.ca/","current":true}]
         },
  "running":true,
  "success":true
}

[edit] lookup

Looks up an object by its handle.
The packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
 "type":"request",
  "command":"lookup",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "arguments":{
                "handle":<handle>
                "includeSource":<include_source>
  },
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
handle a required argument that indicates what object to look up
include_source an optional argument that indicates you want to return the source for the object (if any). Only available in Crossfire 0.3a2 or greater

Example Request

An example of the request you send:

Content-Length:257
\r\n\r\n
{
  "type":"request",
  "command":"lookup",
  "contextId":"xf0.3::8265385",
  "seq":46,
  "arguments":{"handle":10,"includeSource":true},
}
\r\n

Example Response

An example of the response you receive:

Content-Length:320
\r\n\r\n
{
  "type":"response",
  "command":"lookup",
  "contextId":"xf0.3::3775561",
  "seq":10,
  "request_seq":9,
  "body":{
           "type":"function",
           "value":{
                     "constructor":{"type":"function","handle":88},
                     "proto":{"type":"object","handle":89}
                   },
           "source":"function Object() {[native code]}"
         },
  "running":false,
  "success":true,
}

[edit] scope

Returns a particular scope for the specified frame.
This command has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
The request packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":"scope",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "arguments":{
                "index":<scope_number>,
                "frameIndex":<frame_number>
              }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
scope_number a required argument thats indicates which scope to get from the scopes listing. If scope_number is 0, the global scope is returned. If scope_number is NaN or outside the range of scopes no scope information is returned.
frame_number a required argument thats indicates which frame to get the scope from.

Example Request

An example of the request you send:

Content-Length:113
\r\n\r\n
{
  "type":"request",
  "command":"scope",
  "contextId":"xf0.3::6523758",
  "seq":10,
  "arguments":{
                "index":0,
                "frameIndex":0
              }
}
\r\n

The response packet has the following form:

Content-Length:<content_length>
\r\n\r\n
{
  "type":"response",
  "command":"scope",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "request_seq":<request_sequence>,
  "body": {
            "index":<index>,
            "frameIndex":<frame_index>,
            "scope": <scope_ref>
          },
  "running":<is_running>,
  "success":<success_status>,
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this response came from
packet_sequence the packet sequence number
request_sequence the request sequence number
index the index of the scope that was returned
frameIndex the index of the stackframe that the scope was returned from
scope the scope object
running if Crossfire is in a running state
success if the request was successful or not

Example Response

An example of the response you receive:

Content-Length:194
\r\n\r\n
{
  "type":"response",
  "command":"scope",
  "contextId":"xf0.3::6523758",
  "seq":11,
  "request_seq":10,
  "body":{
           "index":0,
           "frameIndex":0
           "scope":{
                     "type":"object",
                     "handle":4
                   }
         },
  "running":false,
  "success":true,
}

[edit] scopes

Returns all the scopes for a frame.
This command has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
The request packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":"scopes",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "arguments":{
                "frameIndex":<frame_index>
              }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
frame_index a required argument thats indicates which frame to get the scopes from.

Example Request

An example of the request you send:

Content-Length:106
\r\n\r\n
{
  "type":"request",
  "command":"scopes",
  "contextId":"xf0.3::6179868",
  "seq":16,
  "arguments":{
                "frameIndex":0
              }
}
\r\n

The response packet has the following form:

Content-Length:<content_length>
\r\n\r\n
{
  "type":"response",
  "command":"scopes",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "request_seq":<request_sequence>,
  "body":{
           <scope_array>
         },
  "running":<is_running>,
  "success":<success_status>,
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this response came from
packet_sequence the packet sequence number
request_sequence the request sequence number
scope_array the array of scope objects if any
running if Crossfire is in a running state
success if the request was successful or not

Example Response

An example of the response you receive:

Content-Length:282
\r\n\r\n
{
  "type":"response",
  "command":"scopes",
  "contextId":"xf0.3::6179868",
  "seq":17,
  "request_seq":16,
  "body":{
           "fromScope":0,
           "toScope":0,
           "totalScopes":1,
           "scopes":[{
                       "index":0,
                       "frameIndex":0,
                       "scope":{"type":"object","handle":19}
                    }]
         },
  "running":false,
  "success":true
}

[edit] script

Retrieve a single script
The request packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request"
  "command":"script",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "arguments":{
                "includeSource":<include_source>,
                "url":<script_url>
              }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
include_source a required argument that indicates if the source for the requested script should be returned in the response
url a required argument that indicates where to get the script from

Example Request

An example of the request you send:

Content-Length:188
\r\n\r\n
{
  "type":"request"
  "command":"script",
  "contextId":"xf0.3::2777681",
  "seq":84,
  "arguments":{
                "includeSource":true,
                "url":"http://www.mozilla.org/script/1.0/jquery-ui-1.7.2.custom.min.js"
              }
}
\r\n

The response packet has the following form:

Content-Length:<content_length>
\r\n\r\n
{
  "type":"response",
  "command":"script",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "request_seq":<request_sequence>,
  "body":{
           "script":<script_object>
          },
  "running":<running>,
  "success":<success>,
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
request_sequence the request sequence number
script_object the requested script object
running if Crossfire is in a running state
success if the request was successful or not

Example Response

An example of the response you receive:

Content-Length:19783
\r\n\r\n
{
  "type":"response",
  "command":"script",
  "contextId":"xf0.3::2777681",
  "seq":85,
  "request_seq":84,
  "body":{
           "script":{
                      "url":"http://www.mozilla.org/script/1.0/jquery-ui-1.7.2.custom.min.js",
                      "lineOffset":0,
                      "columnOffset":0,
                      "lineCount":19,
                      "type":"top-level",
                      "source":"..."
                    }
          },
  "running":true,
  "success":true,
 
}

[edit] scripts

Retrieve all known scripts in a context.
This command has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
The request packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":"scripts",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "arguments":{
                "includeSource":<include_source>
              }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
include_source a required argument that indicates if source should be returned for each of the scripts that are returned

Example Request

An example of the request you send:

Content-Length:112
\r\n\r\n
{
  "type":"request",
  "command":"scripts",
  "contextId":"xf0.3::3788274",
  "seq":52,
  "arguments":{
                "includeSource":true
              }
}
\r\n

The response packet has the following form:

Content-Length:<content_length>
\r\n\r\n
{
  "type":"response",
  "command":"scripts",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "request_seq":<request_sequence>,
  "body":{
           "scripts":<script_array>
         },
  "running":<running>,
  "success":<success>,
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number
request_sequence the packet request sequence number
script_array the array of script objects
running if Crossfire is in a running state
success if the request was successful or not

Example Response

An example of the response you receive:

Content-Length:382
\r\n\r\n
{
  "type":"response",
  "command":"scripts",
  "contextId":"xf0.3::1171142",
  "seq":32,
  "request_seq":31,
  "body":{
           "scripts":[
                      {"url":"http://www.google.ca/","lineOffset":0,"columnOffset":0,"sourceLength":5,"lineCount":40,"type":"top-level"},                
                      {"url":"http://www.google.ca//event/seq/1","lineOffset":0,"columnOffset":0,"sourceLength":3,"lineCount":3,"type":"event"}
                     ]
         },
  "running":true,
  "success":true,
}

[edit] setbreakpoint

Set a breakpoint and return its id.
This command has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
The request packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
 "type":"request"
  "command":"setbreakpoint",
  "seq":<packet_sequence>,
  "arguments":{
                "location":<location_object>,
                "attributes":<attributes_object>
                "type":<type>,
              }
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number
location_object a required argument that specifies the locale to place them breakpoint in, for example the URL of the script and the line within that script
attributes_object an optional argument that specifies the attributes to be set on the breakpoint, for example enabled or condition.
type an optional argument that specifies the kind of breakpoint to create, if omitted, "line" is assumed

Example Request

An example of the request you send:

Content-Length:210
\r\n\r\n
{
  "type":"request",
  "command":"setbreakpoint",
  "seq":42,
  "arguments":{
                "type":"line",
                "location":{
                             "line":2,
                             "url":"http:\/\/www.google.ca\/\/event\/seq\/1"
                           },
                "attributes":{
                               "enabled":true
                               "condition":null
                             }
              }
}
\r\n

The response packet has the following form:

Content-Length:<content_length>
\r\n\r\n
{
  "type":"response",
  "command":"setbreakpoint",
  "seq":<packet_sequence>,
  "request_seq":<request_sequence>,
  "body":{
           <breakpoint_object>
         },
  "running":<is_running>,
  "success":<success_status>,
}

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number
request_sequence the request sequence number
breakpoint_object the breakpoint object for the set breakpoint
running if Crossfire is in a running state
success if the request was successful or not

Example Response

An example of the response you receive:

Content-Length:244
\r\n\r\n
{
  "type":"response",
  "command":"setbreakpoint",
  "seq":44,
  "request_seq":42,
  "body":{
           "breakpoint":{
                          "handle":1,
                          "type":"line",
                          "location":{
                                       "line":2,
                                       "url":"http://www.google.ca//event/seq/1"
                                     },
                          "attributes":{
                                         "enabled":true
                                       }
                        }
         },
  "running":true,
  "success":true
}

[edit] suspend

Try to suspend any currently running JavaScript.
The packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
 "type":"request",
  "command":"suspend",
  "contextId":<context_id>,
  "seq":<packet_sequence>,
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context this request is targeted for
packet_sequence the packet sequence number

Example Request

An example of the request you send:

Content-Length:77
\r\n
{
  "type":"request",
  "command":"suspend",
  "contextId":"xf0.1a::9931113",
  "seq":5, 
}
\r\n

Example Response

An example of the response you receive:

Content-Length:105
\r\n\r\n
{
  "type":"response",
  "command":"suspend",
  "seq":93,
  "request_seq":92,
  "running":true,
  "success":true
}

[edit] version

Returns the Crossfire protocol version. This command does not require a context_id field.
The packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"request",
  "command":"version",
  "seq":<packet_sequence>
}
\r\n

Arguments

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number

Example Request

An example of the request you send:

Content-Length:47
\r\n\r\n
{
  "type":"request"
  "command":"version",
  "seq":10
}
\r\n

Example Response

An example of the response you will receive:

Content-Length:120
\r\n\r\n
{
  "type":"response",
  "command":"version",
  "seq":11,
  "request_seq":10,
  "body":{"version":"0.3"},
  "running":true,
  "success":true
}

[edit] Events

[edit] onBreak

Firebug has suspended ("broken") in a script.
This event has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
Content-Length:<content_length>
\r\n\r\n
{
  "type":"event",
  "event":"onBreak",
  "seq":<packet_sequence>,
  "contextId":<context_id>,
  "data":{
           "location":<location>,
           "cause":<cause>
         }
}

Event Data

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the id of the context that suspended (broke)
packet_sequence the packet sequence number
location the location specific attributes for the event
cause the cause specific attributes of the event

Example

Content-Length:156
\r\n\r\n
{
  "seq":37,
  "type":"event",
  "event":"onBreak",
  "contextId":"xf0.3::5159616",
  "data":{
           "location":{"url":"http://www.google.ca//event/seq/1","line":2},
           "cause":{}
         }
}

[edit] onContextCreated

Fired when a new context is created in Firebug (ex: A new tab was opened and firebug was activated).
This event has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
Content-Length:<content_length>
\r\n\r\n
{
  "type":"event",
  "event":"onContextCreated",
  "seq":<packet_sequence>,
  "body":{
           "url":<url>
           "contextId":<context_id>
         },
}

Event Data

content_length the entire length of the packet content between the curly braces (including the curly braces)
packet_sequence the packet sequence number
url the URL of the page that has been loaded (activated)
context_id the id of the context that was created

Example

Content-Length:142
\r\n\r\n
{
  "type":"event",
  "event":"onContextCreated",
  "seq":5,
  "body":{
           "url":"http://www.mozilla.com/en-US/firefox/central/",
           "contextId":"xf0.3::6985855"
         },
}

[edit] onContextDestroyed

Fired when a Firebug has destroyed a context (ex: Deactivate firebug has been pressed on a tab)
This event has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
Content-Length:91
\r\n\r\n
{
  "type":"event",
  "event":"onContextDestroyed",
  "seq":6,
  "data":{
           "contextId":"xf0.3::2075594"
         }
}

Event Data

There is no additional data for this event. The context that has been destroyed is the one specified in the contextId body value.

[edit] onContextLoaded

A new context (page) has been loaded. Typically this event is sent after a new tab is opened.
This event has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
Content-Length:<content_length>
\r\n\r\n
{
  "type":"event",
  "event":"onContextLoaded",
  "data":{
          "url":<url>,
          "contextId":<context_id>
         },
}

Event Data

content_length the entire length of the packet content between the curly braces (including the curly braces)
url the URL of the context that was loaded
context_id the id of the context that has been loaded

Example

Content-Length:141
\r\n\r\n
{
  "type":"event",
  "event":"onContextLoaded",
  "data":{
          "url":"http://www.mozilla.com/en-US/firefox/central/"
          "contextId":"xf0.3::6985855"
         },
}

[edit] onContextSelected

Fired when the browser is loaded and a context is switched to without having been loaded
This event has been added in Crossfire version 0.3a7, please see the migration guide entry for more information.
The event packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"event"
  "event":"onContextSelected",
  "data":{
           "url":<new_url>,
           "contextId":<new_context_id>,
           "oldUrl":<url>,
           "oldContextId":<context_id>
         },
}

Event Data

content_length the entire length of the packet content between the curly braces (including the curly braces)
new_url the URL of the context that was switched to
new_context_id the Crossfire id of the context that was switched to
url the URL of the context that was switched from
context_id the Crossfire id of the context that was switched from

Example

Content-Length:181
\r\n\r\n
{
  "type":"event"
  "event":"onContextSelected",
  "data":{
           "url":"http://www.google.ca/advanced_search?hl=en",
           "contextId":"xf0.3::9202767",
           "oldUrl":"http://www.ubuntulinux.org/",
           "oldContextId":"xf0.3::9202766"
         },
}

[edit] onError

Fired when an error is written to the console or console.error() is used.
Content-Length:471
\r\n\r\n
{
  "type":"event",
  "event":"onError",
  "contextId":"xf0.3::8821652",
  "seq":136,
  "data":{
           "type":"object",
           "value":{
                     "message":{"type":"string","value":"foo"},
                     "href":{"type":"string","value":"http://www.google.ca/"},
                     "lineNo":{"type":"number","value":0},
                     "source":{"type":"string","value":""},
                     "category":{"type":"string","value":"error"},
                     "context":{"type":"object","handle":24},
                     "trace":{"type":"undefined"},
                     "msgId":{"type":"undefined"},
                     "constructor":{"type":"function","handle":3}
                   }
         }
}

Event Data

data the error information and stack written to the console

[edit] onResume

Fired when a context is resumed (after being suspended)
Content-Length:75
\r\n\r\n
{
  "type":"event",
  "event":"onResume",
  "contextId":"xf0.3::8127621",
}

Event Data

There is no additional event data. The context that has been resumed in the one specified in the context_id parameter.

[edit] onScript

Fired when a new script is compiled.
Content-Length:<content_length>
\r\n\r\n
{
  "type":"event",
  "event":<event>,
  "contextId":<context_id>,
  "seq":<packet_sequence>,
  "data":{<script_object>}
}

Event Data

content_length the entire length of the packet content between the curly braces (including the curly braces)
event the name of the event. A complete listing of events that can appear in <event> are available in the Events section.
context_id the id of the context this event came from
packet_sequence the packet sequence number
script_object the script object that was created

Example

Content-Length:631
\r\n\r\n
{
  "seq":10,
  "type":"event",
  "event":"onScript",
  "contextId":"xf0.3::2531266",
  "data":{
           "script": {
                       "url":"http://www.google.ca/advanced_search?hl=en",
                       "lineOffset":0,
                       "columnOffset":0,
                       "sourceLength":311,
                       "lineCount":311,
                       "compilationType":"top-level"
                     }
          }
}

[edit] onToggleBreakpoint

Fired when a breakpoint is created or removed.
This event has been added in Crossfire version 0.3a7, please see the migration guide entry for more information.
The event packet has the following form:
Content-Length:<content_length>
\r\n\r\n
{
  "type":"event"
  "event":"onToggleBreakpoint",
  "contextId":<context_id>
  "data":{
           "breakpoint":<breakpoint>,
           "props":<properties>
           "set":<isset>,
         },
}

Event Data

content_length the entire length of the packet content between the curly braces (including the curly braces)
context_id the Crossfire id of the context that sent the event
breakpoint the breakpoint object that was toggled
properties the additional listing of properties that can accompany the event
isset if the breakpoint has been concretely set in a script

Example

Content-Length:255
\r\n\r\n
{
"type":"event",
"event":"onToggleBreakpoint",
"contextId":"xf0.3::5524167",
"seq":14,
"data":{
         "breakpoint":{
                        "handle":3,
                        "type":"line",
                        "location":{"line":2,"url":"http://www.google.ca//event/seq/1"},
                        "attributes":{"enabled":true,"condition":null}
                      },
         "set":true
       }
}

[edit] Console Tool Events

The console tools will only send any of the following events if they are enabled. By default the console tools are not enabled.

Clients can automatically turn on the console tool via a modified handshake. For more information about the console tool and how to enable and use it see the Console Tool API documentation.

[edit] onConsoleDebug

Fired when debug information is written to the console or console.debug() is used.
Content-Length:198
\r\n
tool:console
\r\n\r\n
{
  "type":"event",
  "event":"onConsoleDebug",
  "contextId":"xf0.3::8821652",
  "seq":127,
  "data":{
           "type":"object",
           "value":{
                     "0":{"type":"string","value":"foo"},
                     "constructor":{"type":"function","handle":21}
           }
  }
}

Event Data

data the debug information written to the console

[edit] onConsoleInfo

Fired when information is written to the console or console.info() is used.
Content-Length:197
\r\n
tool:console
\r\n\r\n
{
  "type":"event",
  "event":"onConsoleInfo",
  "contextId":"xf0.3::8821652",
  "seq":144,
  "data":{
           "type":"object",
           "value":{
                     "0":{"type":"string","value":"foo"},
                     "constructor":{"type":"function","handle":21}
           }
  }
}

Event Data

data the log information written to the console

[edit] onConsoleLog

Fired when a log entry is written to the console or console.log() is used.
Content-Length:196
\r\n
tool:console
\r\n\r\n
{
  "type":"event",
  "event":"onConsoleLog",
  "contextId":"xf0.3::8821652",
  "seq":118,
  "data":{
           "type":"object",
           "value":{
                     "0":{"type":"string","value":"foo"},
                     "constructor":{"type":"function","handle":21}
           }
  }
}

Event Data

data the log information written to the console

[edit] onConsoleWarn

Fired when a warning is written to the console or console.warn() is used.
Content-Length:197
\r\n
tool:console
\r\n\r\n
{
  "type":"event",
  "event":"onConsoleWarn",
  "contextId":"xf0.3::8821652",
  "seq":152,
  "data":{
           "type":"object",
           "value":{
                     "0":{"type":"string","value":"foo"},
                     "constructor":{"type":"function","handle":21}
           }
  }
}

Event Data

data the warning written to the console

[edit] DOM Tool Events

The DOM tools alert clients to changes in the DOM. By default the DOM tools are not enabled.

Clients can automatically turn on the DOM tool via a modified handshake. For more information about the DOM tool and how to enable and use it see the DOM Tool API documentation.

[edit] onDomMutate

Content-Length:87
\r\n
tool:dom
\r\n\r\n
{
  "type":"event",
  "event":"onDomMutate",
  "contextId":"xf0.3::8821652",
  "seq":50,
  "data":{}
}

Event Data

[edit] Inspect Tool Events

The Inspector tools notify clients of element inspections in Firebug. By default the Inspector tool is not enabled.

Clients can automatically turn on the inspector tool via a modified handshake. For more information about the inspector tool and how to enable and use it see the Inspector Tool API documentation.

[edit] onInspectNode

Fired when Firebug is in 'Inspect Mode' and DOM elements are inspected. The event contains the path to the DOM element being inspected at the time the even was fired.
Content-Length:186
\r\n\r\n
{
  "type":"event",
  "event":"onInspectNode",
  "contextId":"xf0.3::7640266",
  "seq":66,
  "data":{
           "node":"/html[1]/body[1]/div[1]/div[4]/div[1]/div[1]/div[2]/div[2]/div[7]/div[1]/span[2]/span[1]"
         }
}

Event Data

node the complete unique path to the element being inspected in the DOM.

[edit] Net Tool Events

The Net tools notify users of information changes in the Net panel. By default the Net tools are not enabled.

Clients can automatically turn on the net tool via a modified handshake. For more information about the net tool and how to enable and use it see the Net Tool API documentation.

[edit] Trace Tool Events

The Trace tool allows additional debug information about what the Crossfire server is doing at any given time to be sent to the remote client. By default the Trace tool is not enabled.

Clients can automatically turn on the trace tool via a modified handshake. For more information about the trace tool and how to enable and use it see the Trace Tool API documentation.

Personal tools