Crossfire 0.3a5 Migration

From FirebugWiki

(Difference between revisions)
Jump to: navigation, search
m (getbreakpoint)
m (clearbreakpoint)
Line 51: Line 51:
== clearbreakpoint ==
== clearbreakpoint ==
-
 
+
:
 +
The related work item is: [http://code.google.com/p/fbug/issues/detail?id=3928 Issue 3928]
 +
:
[[Crossfire_Protocol_Reference#clearbreakpoint|clearbreakpoint]]
[[Crossfire_Protocol_Reference#clearbreakpoint|clearbreakpoint]]

Revision as of 17:13, 14 March 2011

Contents

Crossfire 0.3a5 Migration Guide

During 0.3a5 development there was a lot of work done to make the protocol more consistent and coherent, as expected, this work brought with it many changes to the protocol and a few changes that are no longer compatible with existing versions of Crossfire.

This guide will help ease the transition from using a pre-0.3a5 version of Crossfire, with each affected protocol entity described in its own following section.

changebreakpoint

changebreakpoint

Example Request

An example of the request you send:

Content-Length:115
\r\n\r\n
{
  "type":"request",
  "command":"changebreakpoint",
  "context_id":"xf0.3::1021597",
  "seq":21,
  "arguments":{"breakpoint":7},
}
\r\n

Example Response

An example of the response you receive:

Content-Length:115
\r\n\r\n
{
  "type":"response",
  "command":"changebreakpoint",
  "seq":22,
  "request_seq":21,
  "body":{},
  "running":true,
  "success":false
}

New in 0.3a5

  1. You must pass in the "handle" argument to denote which breakpoint to edit
  2. You can optionally specify a "condition" argument to set as the new condition - null removes a condition previously set
  3. You can optionally specify an "enabled" argument to enable / disable a breakpoint
  4. The response will now contain the handle of the breakpoint if the change request succeeded

clearbreakpoint

The related work item is: Issue 3928

clearbreakpoint

Example Request

An example of the request you send:

Content-Length:194
\r\n\r\n
{
  "type":"request",
  "command":"clearbreakpoint",
  "context_id":"xf0.3::6179868",
  "seq":9,
  "arguments":{
                "target":"http://www.mozilla.com/includes/yui/2.5.1/animation/animation-min.js", 
                "line":8
              },
}
\r\n

Example Response

An example of the response you receive:

Content-Length:187
\r\n\r\n
{
  "command":"clearbreakpoint",
  "context_id":"xf0.3::6179868",
  "type":"response",
  "seq":13,
  "request_seq":9,
  "body":{
           "context_id":"xf0.3::6179868",
           "breakpoint":18
         },
  "running":true,
  "success":true
}

New in 0.3a5

  1. You must specify the "handle" argument for the breakpoint you wish to remove
  2. You no longer specify the line or URL information in the request
  3. The response no longer contains the information for the breakpoint that was removed

getbreakpoint

The related work item is: Issue 3928

getbreakpoint

Example Request

An example of the request you send:

Content-Length:112
\r\n\r\n
{
  "type":"request",
  "command":"getbreakpoint",
  "context_id":"xf0.3::1021597",
  "seq":16,
  "arguments":{"breakpoint":5}
}
\r\n

Example Response

An example of the response you receive:

Content-Length:224
\r\n\r\n
{
  "type":"response",
  "command":"getbreakpoint",
  "seq":17,
  "request_seq":16,
  "body":{
           "handle":5,
           "type":"line",
           "line":7,
           "target":"http://www.mozilla.com/includes/yui/2.5.1/animation/animation-min.js"
         },
  "running":true,
  "success":true
}

Pending changes in 0.3a5

  1. "context_id" will be ignored in the request and not supplied in the response
  2. the "breakpoint" argument will change name to "handle"

getbreakpoints

The related work item is: Issue 3928

getbreakpoints

Example Request

An example of the request you send:

Content-Length:84
\r\n\r\n
{
 "type":"request",
 "command":"getbreakpoints",
 "context_id":"xf0.3::6179868",
 "seq":12,
}
\r\n

Example Response

An example of the response you receive:

Content-Length:312
\r\n\r\n
{
  "type":"response",
  "command":"getbreakpoints",
  "context_id":"xf0.3::6179868",
  "seq":13,
  "request_seq":12,
  "body":{
           "context_id":"xf0.3::6179868",
           "breakpoints":[{
                            "handle":27,
                            "type":"line",
                            "line":7,
                            "target":"http://www.mozilla.com/includes/yui/2.5.1/yahoo-dom-event/yahoo-dom-event.js"
                         }]
         },
  "running":true,
  "success":true
}

New in 0.3a5

  1. You can optionally specify a "context_id" argument that will return only the collection of breakpoint ids that apply to that context
  2. The "context_id" attribute has been removed from the response

setbreakpoint

The related work item is: Issue 3928

setbreakpoint

Example Request

An example of the request you send:

Content-Length:192
\r\n\r\n
{
  "type":"request"
  "command":"setbreakpoint",
  "context_id":"xf0.3::6179868",
  "seq":5,
  "arguments":{
                "target":"http://www.mozilla.com/includes/yui/2.5.1/animation/animation-min.js",
                "line":8
              }
}
\r\n

Example Response

An example of the response you receive:

Content-Length:298
\r\n\r\n
{
  "type":"response",
  "command":"setbreakpoint",
  "context_id":"xf0.3::6179868",
  "seq":9,
  "request_seq":5,
  "body":{
           "context_id":"xf0.3::6179868",
           "breakpoint":{
                          "handle":22,
                          "type":"line",
                          "line":8,
                          "target":"http://www.mozilla.com/includes/yui/2.5.1/animation/animation-min.js"
                        }
          },
  "running":true,
  "success":true,
}

New in 0.3a5

  1. The arguments are changing to include a "location" argument that will contain the placement information for the breakpoint. For example "arguments":{"location":{"url":"www.goolge.ca","line":3}}
  2. Optionally you can specify a "context_id" argument the breakpoint should apply to
  3. Optionally you can specify the enablement of the breakpoint using the "enabled" argument
  4. Optionally you can specify a condition for the breakpoint using the "condition" argument

updatecontext

The updatecontext request has been added to the protocol in a5 and allows you to load a new URL into an existing context.

The related work item is: Issue 3841

Action Required

None, unless you want to support or use the new request

Details

Details on the new request can be found on the protocol reference page.

onScript

The onScript event has been updated to return attributes with consistent names and the meta-data about the script that was loaded.

The related work item is: Issue 3476

Action Required

The following changes require clients to discontinue using two removed attributes; href and context_href and begin using the new script object.

Details

In the pre-0.3a5 versions of Crossfire the onScript event had the following form:

Content-Length:192
\r\n\r\n
{
  "type":"event",
  "event":"onScript",
  "context_id":"xf0.3::8127620",
  "body":{
           "context_href":"http://www.google.ca/advanced_search?hl=en/4",
           "href":"http://www.google.ca/advanced_search?hl=en"
         }
}

The following has changed:

  • the body object no longer contains an href or context_href entry
  • the body object now contains the script meta-data object, identical to what is returned via a script request with no included source.

New event form:

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

The values and kinds of the script object are as follows:

id a String identifier for the script - never null
lineOffset a Number representing the line offset of the script - never less than 0
columnOffset a Number representing the column offset of the script - never less than 0
sourceStart a String representing the first line of source in the script - never null
sourceLength a Number representing the entire length of the source of the script - never less than 0
lineCount a Number representing the total number of lines of source in the script - never less than 0
compilationType a String describing the kind of the script - see sourceFile.js for complete listing of types

onToggleBreakpoint

The related work item is: Issue 3928

onToggleBreakpoint

Content-Length:153
\r\n\r\n
{
  "type":"event",
  "event":"onToggleBreakpoint",
  "context_id":"xf0.3::7640268",
  "seq":20,
  "data":{
           "url":"http://localhost:8080/js/e4.js",
           "line":19,
           "set":true
         }
}
Personal tools