Crossfire 0.3a7 Migration
From FirebugWiki
m (→scopes) |
m (→scopes) |
||
| Line 801: | Line 801: | ||
</source> | </source> | ||
| - | == | + | == setbreakpoint == |
The <code>setbreakpoint</code> [[Crossfire_Protocol_Reference#setbreakpoint|request]] has been updated to move all breakpoint attributes from the root of the arguments object to the <code>attributes</code> object argument. | The <code>setbreakpoint</code> [[Crossfire_Protocol_Reference#setbreakpoint|request]] has been updated to move all breakpoint attributes from the root of the arguments object to the <code>attributes</code> object argument. | ||
Revision as of 03:20, 15 June 2011
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
stepactionargument has been renamed tostepAction.
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
frameargument has been renamed toframeIndex.
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, }
frame
The frame request has been updated to accept the index argument.
Action Required
Clients must discontinue use of the number argument and begin using index.
Details
In pre-0.3a7 versions the request had the form:
Content-Length:120 \r\n\r\n { "type":"request", "command":"frame", "contextId":"xf0.3::7322351", "seq":33, "arguments":{ "number":0, "includeScopes":true }, } \r\n
The following has changed:
- the
numberargument has been renamed toindex.
New request form:
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 not changed.
listcontexts
The listcontexts request has been updated to rename the href body value to url.
Action Required
Clients must discontinue use of the href and context_id body values and begin using url and contextId respectively.
Details The request packet has not changed.
In pre-0.3a7 versions the response had the form:
Content-Length:196 \r\n\r\n { "type":"response", "command":"listcontexts", "seq":6, "request_seq":5, "body":{ "contexts":[{"context_id":"xf0.3::5482594","href":"http://www.google.ca/","current":true}] }, "running":true, "success":true }
The following has changed:
- the
context_idbody value has been renamed tocontextId. - the
hrefbody value has been renamed tourl.
New response form:
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 }
onBreak
The onBreak event has been updated to place location information in a new location body object and include a new cause body object.
Action Required
Clients must discontinue use of the line and url body values and begin using the location body object to find these values. Clients can also optionally begin using the cause body object to retrieve causal information about the event.
Details
In pre-0.3a7 versions the event had the form:
Content-Length:156 \r\n\r\n { "seq":37, "type":"event", "event":"onBreak", "contextId":"xf0.3::5159616", "data":{ "url":"http://www.google.ca//event/seq/1", "line":2 } }
The following has changed:
- the
urlbody value has been removed and placed in thelocationbody object - the
linebody value has been removed and placed in thelocationbody object - the new body object
locationhas been added - the new body object
causehas been added
New event form:
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":{} } }
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 oldUrl and discontinue use of the new_href body value and begin using url. Lastly clients must begin using the new body values contextId and oldContextId.
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
onContextChangedtoonContextSelected - the
hrefbody value has been replaced witholdUrl - the
new_hrefbody value has been replaced withurl - the new body value
contextIdhas been added - the new body value
oldContextIdhas been added
New event form:
Content-Length:181 \r\n\r\n { "type":"event" "event":"onContextSelected", "seq":19, "data":{ "url":"http://www.google.ca/advanced_search?hl=en", "contextId":"xf0.3::9202767", "oldUrl":"http://www.ubuntulinux.org/", "oldContextId":"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
hrefbody value has been replaced withurl - the
context_idhas been removed from the root of the event packet - the
contextIdvalue 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
contextIdhas been added - the new body value
newContextIdhas 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
hrefbody value has been replaced withurl - the root
context_idhas been removed - the new body value
contextIdhas 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
handlebody value has been removed - the
locationbody value has been removed - the
breakpointbody 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
scriptnesting 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, }
scope
The scope request has been updated to accept the new index and frameIndex arguments as well as update the response body value object to scope.
This command has been updated in Crossfire version 0.3a7, please see the migration guide entry for more information.
Action Required
Clients must discontinue use of the number and frameNumber arguments and also discontinue use of the object response body value and begin using scope.
Details
In pre-0.3a7 versions the request had the following form:
Content-Length:116 \r\n\r\n { "type":"request", "command":"scope", "contextId":"xf0.3::6179868", "seq":20, "arguments":{ "number":0, "frameNumber":0 } } \r\n
The following has changed:
- the
numberargument has been renamed toindex - the
frameNumberargument has been renamed toframeIndex
Content-Length:116 \r\n\r\n { "type":"request", "command":"scope", "contextId":"xf0.3::6179868", "seq":20, "arguments":{ "index":0, "frameIndex":0 } } \r\n
In pre-0.3a7 versions the response had the following form:
Content-Length:226 \r\n\r\n { "type":"response", "command":"scope", "contextId":"xf0.3::6179868", "seq":21, "request_seq":20, "body":{ "index":0, "frameIndex":0, "object":{"type":"ref","handle":"19"} }, "running":false, "success":true }
The following has changed:
- the
objectbody value has been renamed toscope
Content-Length:226 \r\n\r\n { "type":"response", "command":"scope", "contextId":"xf0.3::6179868", "seq":21, "request_seq":20, "body":{ "index":0, "frameIndex":0, "scope":{"type":"ref","handle":"19"} }, "running":false, "success":true }
scopes
The scopes request has been updated to accept the frameIndex argument as well as update the response body value to use the new scope object form.
Action Required
Clients must discontinue use of the frameNumber argument and discontinue use of the old scope object form. For more information on the new scope object shape, see the new scope request migration entry.
Details
In pre-0.3a7 versions the request had the following form:
Content-Length:106 \r\n\r\n { "type":"request", "command":"scopes", "contextId":"xf0.3::6179868", "seq":16, "arguments":{ "frameNumber":0 } } \r\n
The following has changed:
- the
frameNumberargument has been renamed toframeIndex
Content-Length:106 \r\n\r\n { "type":"request", "command":"scopes", "contextId":"xf0.3::6179868", "seq":16, "arguments":{ "frameIndex":0 } } \r\n
In pre-0.3a7 versions the response had the following form:
Content-Length:282 \r\n\r\n { "type":"response", "command":"scopes", "contextId":"xf0.3::6179868", "seq":17, "request_seq":16, "body":{ "fromScope":0, "toScope":1, "totalScopes":2, "scopes":[{ "number":0, "frameNumber":0, "object":{"type":"object","handle":19} }] }, "running":false, "success":true }
The following has changed:
- the
scopesbody value has an updatedscopeobject.
Content-Length:282 \r\n\r\n { "type":"response", "command":"scopes", "contextId":"xf0.3::6179868", "seq":17, "request_seq":16, "body":{ "fromScope":0, "toScope":1, "totalScopes":2, "scopes":[{ "index":0, "frameIndex":0, "scope":{"type":"object","handle":19} }] }, "running":false, "success":true }
setbreakpoint
The setbreakpoint request has been updated to move all breakpoint attributes from the root of the arguments object to the attributes object argument.
Action Required
Clients must discontinue placing breakpoint attributes in the root of the arguments object and instead place them in the attributes object argument.
Details
In pre-0.3a7 versions the request had the following form:
Content-Length:196 \r\n\r\n { "type":"request", "command":"setbreakpoint", "contextId":"xf0.3::2531266", "seq":42, "arguments":{ "enabled":true, "type":"line" "condition":null, "location":{ "line":2, "url":"http:\/\/www.google.ca\/\/event\/seq\/1" } } } \r\n
The following has changed:
- all attributes are now placed in the
attributesobject argument
Content-Length:210 \r\n\r\n { "type":"request", "command":"setbreakpoint", "contextId":"xf0.3::5132315", "seq":42, "arguments":{ "type":"line", "location":{ "line":2, "url":"http:\/\/www.google.ca\/\/event\/seq\/1" }, "attributes":{ "enabled":true "condition":null } } } \r\n
In pre-0.3a7 versions the response had the following form:
Content-Length:230 \r\n\r\n { "seq":44, "type":"response", "command":"setbreakpoint", "request_seq":42, "body":{ "breakpoint":{ "handle":7, "type":"line", "enabled":true, "location":{ "line":2, "url":"http://www.google.ca//event/seq/1" } } }, "running":false, "success":true }
The following has changed:
- all attributes are now found in the
attributesbody object
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 }
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
hrefargument has been replaced withurl - the
context_idargument has been moved into theargumentsobject - the
context_idargument has been renamed tocontextId
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.