Crossfire 0.3a7 Migration

From FirebugWiki

Revision as of 20:35, 2 June 2011 by Mrennie (Talk | contribs)
Jump to: navigation, search

Contents

Crossfire 0.3a7 Migration Guide

During 0.3a7 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.3a7 version of Crossfire, with each affected protocol entity described in its own following section.

context_id

In an effort to make the protocol as consistent as possible the last remaining packet attribute has been camel-cased. The changes made are a protocol-wide rename of context_id to contextId.

Action Required

Clients must discontinue use of the context_id attribute in all request, response and event packets and begin using the contextId attribute.

Details

No additional details.

continue

The continue request has been updated to accept the stepAction argument.

Action Required

Clients must discontinue use of the stepaction argument and begin using stepAction.

Details

In pre-0.3a7 versions the request had the form:

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

The following has changed:

  • the stepaction argument has been renamed to stepAction.

New request form:

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

The response packet has not changed.

evaluate

The evaluate request has been updated to accept the frameIndex argument and serialize all results.

Action Required

Clients must discontinue use of the frame argument and begin using frameIndex. Clients can also know what kind of values have been returned because all values are no properly serialized as outlined in the protocol specification.

Details

In pre-0.3a7 versions the request had the form:

Content-Length:<content_length>
\r\n\r\n
{
  "command":"evaluate",
  "type":"request",
  "context_id":"xf0.3::3442767",
  "seq":20,
  "arguments":{
                "expression":"3+4",
                "frame":0
              }
}
\r\n

The following has changed:

  • the frame argument has been renamed to frameIndex.

New request form:

Content-Length:<content_length>
\r\n\r\n
{
  "command":"evaluate",
  "type":"request",
  "contextId":"xf0.3::3442767",
  "seq":21,
  "arguments":{
                "expression":"3+4",
                "frameIndex":0
              }
}
\r\n

In pre-0.3a7 versions the response had the following form:

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

The following has changed:

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

onContextChanged

The onContextChanged event has been renamed to onContextSelected and the body values have been updated: href to url and new_href to newUrl. The event also has no root context_id entry and the body has two additional values contextId and newContextId.

Action Required

Clients must discontinue use of the onContextChanged event name and begin using onContextSelected. Clients also must discontinue use of the href body value and begin using url and discontinue use of the new_href body value and begin using newUrl. Lastly clients must begin using the new body values contextId and newContextId.

Details

In pre-0.3a7 versions the event had the form:

Content-Length:181
\r\n\r\n
{
  "type":"event"
  "event":"onContextChanged",
  "context_id":"xf0.3::8127619",
  "seq":19,
  "data":{
           "new_href":"http://www.google.ca/advanced_search?hl=en",
           "href":"http://www.ubuntulinux.org/"
         },
}

The following has changed:

  • the event has been renamed from onContextChanged to onContextSelected
  • the href body value has been replaced with url
  • the new_href body value has been replaced with newUrl
  • the new body value contextId has been added
  • the new body value newContextId has been added

New event form:

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

onContextCreated

The onContextCreated event has been updated to change the name of the href body value to url and remove the context_id attribute from the root of the packet and add a new contextId value to the body.

Action Required

Clients must discontinue use of the href body value and begin using url, as well as discontinue use of the context_id in the root of the packet and being using the contextId value in the body.

Details

In pre-0.3a7 versions the event had the form:

Content-Length:142
\r\n\r\n
{
  "type":"event",
  "event":"onContextCreated",
  "context_id":"xf0.3::558234",
  "seq":19,
  "body":{
           "href":"http://www.mozilla.com/en-US/firefox/central/"
         },
}

The following has changed:

  • the href body value has been replaced with url
  • the context_id has been removed from the root of the event packet
  • the contextId value has been added

New event form:

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

onContextDestroyed

The onContextDestroyed event has been updated to remove the root context_id entry and place it in the newContextId body value.

Action Required

Clients must discontinue using the context_id attribute from the root of the packet and begin using the new body value contextId.

Details

In pre-0.3a7 versions the event had the form:

Content-Length:75
\r\n\r\n
{
  "type":"event",
  "event":"onContextDestroyed",
  "context_id":"xf0.3::8127624",
  "seq":6
}

The following has changed:

  • the new body value contextId has been added
  • the new body value newContextId has been added

New event form:

Content-Length:91
\r\n\r\n
{
  "type":"event",
  "event":"onContextDestroyed",
  "seq":6,
  "data":{
           "contextId":"xf0.3::2075594"
         }
}

onContextLoaded

The onContextLoaded event has been updated to change the name of the href body value to url and to remove the context_id from the root of the event and place it in the body using the new contextId value.

Action Required

Clients must discontinue use of the href body value and begin using url and discontinue use of the context_id in the root of the event and being using the contextId body value.

Details

In pre-0.3a7 versions the event had the form:

Content-Length:142
\r\n\r\n
{
  "type":"event",
  "event":"onContextLoaded",
  "context_id":"xf0.3::558234",
  "seq":19,
  "body":{
           "href":"http://www.mozilla.com/en-US/firefox/central/"
         },
}

The following has changed:

  • the href body value has been replaced with url
  • the root context_id has been removed
  • the new body value contextId has been added

New event form:

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

onToggleBreakpoint

The onToggleBreakpoint event has been updated to supply the complete breakpoint object in the data section.

Action Required

Clients must discontinue using the location and handle body values and begin using the breakpoint value.

Details

In pre-0.3a7 versions the event had the form:

Content-Length:150
\r\n\r\n
{
  "type":"event",
  "event":"onToggleBreakpoint",
  "context_id":"xf0.3::2531266",
  "seq":26,
  "data":{
           "handle":4,
           "set":false,
           "location":{
                        "line":2,
                        "url":"http://www.google.ca//event/seq/1"
                      } 
         }
}

The following has changed:

  • the handle body value has been removed
  • the location body value has been removed
  • the breakpoint body value has been added

New event form:

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
       }
}

onToggleDOMBreakpoint

The onToggleDOMBreakpoint event has been removed. The event has been merged with onToggleBreakpoint.

Action Required

Clients must discontinue use of the onToggleDOMBreakpoint event and listen for an onToggleBreakpoint event in its place.

Details

There are no further details.

scripts

The scripts request has been updated to remove unnecessary nesting of JSON objects.

Action Required

Clients must discontinue use of the nested script entries in the response.

Details

The request packet has not changed.

In pre-0.3a7 versions the response had the following form:

Content-Length:78967
\r\n\r\n
{
  "type":"response",
  "command":"scripts",
  "contextId":"xf0.3::3788274",
  "seq":53,
  "request_seq":52,
  "body":{
           "scripts":[{"script":{
                                  "url":"http://www.mozilla.org/",
                                  "lineOffset":0,
                                  "columnOffset":0,
                                  "sourceLength":298,
                                  "lineCount":298,
                                  "type":"URLOnly",
                                  "source":"..."}
                       }},
                       {"script": {...}}
                     ]
         },
  "running":true,
  "success":true,
}

The following has changed:

  • the unnecessary script nesting has been removed from the JSON.
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,
}

source

The source request has been removed. The results of the request are the same as using the script request specifying the includeSource argument set to true.

Action Required

Clients must discontinue use of the source request and begin using the script request with the includeSource argument set to true.

Details

There are no further details.

updatecontext

The updatecontext request has been renamed to better reflect what it actually does. The new name of the request is createcontext.

Aside from the rename of the request, two other changes have been made:

Action Required

Clients must discontinue use of the updatecontext request and begin using createcontext, and must begin using the new url argument. Clients must also note the change in location of the context_id optional argument in the packet.

Details

In pre-0.3a7 version the request had the form:

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

The following has changed:

  • the href argument has been replaced with url
  • the context_id argument has been moved into the arguments object
  • the context_id argument has been renamed to contextId

New request form:

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

The response packet has not changed.

Personal tools