Crossfire 0.3a5 Migration

From FirebugWiki

(Difference between revisions)
Jump to: navigation, search
m (changebreakpoint)
m (Replaced content with "#REDIRECT [https://github.com/firebug-crossfire/crossfire/wiki/Crossfire-0.3a4-to-0.3a5-migration 0.3a5 Migration on Github]")
 
(16 intermediate revisions not shown)
Line 1: Line 1:
-
== Crossfire 0.3a5 Migration Guide ==
+
#REDIRECT [https://github.com/firebug-crossfire/crossfire/wiki/Crossfire-0.3a4-to-0.3a5-migration 0.3a5 Migration on Github]
-
 
+
-
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 ==
+
-
The <code>changebreakpoint</code> [[Crossfire_Protocol_Reference#changebreakpoint|request]] has been updated so that you must pass in the <code>handle</code> argument and can optionally specify the <code>enabled</code> or <code>condition</code> arguments. The response has also been updated to return the <code>breakpoint</code> object of the modified breakpoint - if the request was successful.
+
-
:
+
-
The related work item is: [http://code.google.com/p/fbug/issues/detail?id=3928 Issue 3928]
+
-
:
+
-
'''Action Required'''
+
-
:
+
-
The following changes require clients to discontinue using the <code>breakpoint</code> argument and to begin using the <code>handle</code> argument and optionally use the <code>enabled</code> and <code>condition</code> arguments.
+
-
:
+
-
'''Details'''
+
-
:
+
-
In pre-0.3a5 versions the request had the form:
+
-
:
+
-
<source lang="javascript">
+
-
Content-Length:115
+
-
\r\n\r\n
+
-
{
+
-
  "type":"request",
+
-
  "command":"changebreakpoint",
+
-
  "context_id":"xf0.3::1021597",
+
-
  "seq":21,
+
-
  "arguments":{"breakpoint":7}
+
-
}
+
-
\r\n
+
-
</source>
+
-
:
+
-
The following has changed:
+
-
*the <code>arguments</code> object no longer supports the <code>breakpoint</code> entry
+
-
*the <code>arguments</code> object now supports the <code>handle</code> entry and optionally the <code>enabled</code> and <code>condition</code> entres
+
-
:
+
-
New request form:
+
-
:
+
-
<source lang="javascript">
+
-
Content-Length:115
+
-
\r\n\r\n
+
-
{
+
-
  "type":"request",
+
-
  "command":"changebreakpoint",
+
-
  "context_id":"xf0.3::1021597",
+
-
  "seq":21,
+
-
  "arguments":{
+
-
                "handle":7,
+
-
                "enabled":true,
+
-
                "condition":"y == 6"
+
-
              }
+
-
}
+
-
\r\n
+
-
</source>
+
-
:
+
-
In pre-0.3a5 versions the response you get had the form:
+
-
:
+
-
<source lang="javascript">
+
-
Content-Length:115
+
-
\r\n\r\n
+
-
{
+
-
  "type":"response",
+
-
  "command":"changebreakpoint",
+
-
  "seq":22,
+
-
  "request_seq":21,
+
-
  "body":{},
+
-
  "running":true,
+
-
  "success":true
+
-
}
+
-
</source>
+
-
:
+
-
The following has changed:
+
-
*the <code>body</code> object contains the <code>breakpoint</code> object of the breakpoint that was changed
+
-
:
+
-
New response form:
+
-
<source lang="javascript">
+
-
Content-Length:115
+
-
\r\n\r\n
+
-
{
+
-
  "type":"response",
+
-
  "command":"changebreakpoint",
+
-
  "seq":22,
+
-
  "request_seq":21,
+
-
  "body":{
+
-
          "breakpoint": {
+
-
                          "handle":7,
+
-
                          "type":"line",
+
-
                          "enabled":true,
+
-
                          "condition":"y == 6",
+
-
                          "location":{
+
-
                                      "line":2,
+
-
                                      "url":"http://www.google.ca//event/seq/1"
+
-
                                    }
+
-
                        }
+
-
        },
+
-
  "running":true,
+
-
  "success":true
+
-
}
+
-
</source>
+
-
 
+
-
== clearbreakpoint ==
+
-
:
+
-
The related work item is: [http://code.google.com/p/fbug/issues/detail?id=3928 Issue 3928]
+
-
:
+
-
[[Crossfire_Protocol_Reference#clearbreakpoint|clearbreakpoint]]
+
-
 
+
-
'''Example Request'''
+
-
:
+
-
An example of the request you send:
+
-
:
+
-
<source lang="javascript">
+
-
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
+
-
</source>
+
-
:
+
-
'''Example Response'''
+
-
:
+
-
An example of the response you receive:
+
-
:
+
-
<source lang="javascript">
+
-
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
+
-
}
+
-
</source>
+
-
:
+
-
'''New in 0.3a5'''
+
-
# You must specify the "handle" argument for the breakpoint you wish to remove
+
-
# You no longer specify the line or URL information in the request
+
-
# The response no longer contains the information for the breakpoint that was removed
+
-
 
+
-
== getbreakpoint ==
+
-
:
+
-
The related work item is: [http://code.google.com/p/fbug/issues/detail?id=3928 Issue 3928]
+
-
:
+
-
[[Crossfire_Protocol_Reference#getbreakpoint|getbreakpoint]]
+
-
 
+
-
'''Example Request'''
+
-
:
+
-
An example of the request you send:
+
-
:
+
-
<source lang="javascript">
+
-
Content-Length:112
+
-
\r\n\r\n
+
-
{
+
-
  "type":"request",
+
-
  "command":"getbreakpoint",
+
-
  "context_id":"xf0.3::1021597",
+
-
  "seq":16,
+
-
  "arguments":{"breakpoint":5}
+
-
}
+
-
\r\n
+
-
</source>
+
-
:
+
-
'''Example Response'''
+
-
:
+
-
An example of the response you receive:
+
-
:
+
-
<source lang="javascript">
+
-
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
+
-
}
+
-
</source>
+
-
 
+
-
'''Pending changes in 0.3a5'''
+
-
:
+
-
#"context_id" will be ignored in the request and not supplied in the response
+
-
#the "breakpoint" argument will change name to "handle"
+
-
 
+
-
== getbreakpoints ==
+
-
The <code>getbreakpoints</code> [[Crossfire_Protocol_Reference#getbreakpoints|request]] has been updated make use of the new <code>location</code> object for breakpoints and to remove extraneous entries from responses.
+
-
:
+
-
The related work item is: [http://code.google.com/p/fbug/issues/detail?id=3928 Issue 3928]
+
-
:
+
-
'''Action Required'''
+
-
:
+
-
:
+
-
'''Details'''
+
-
:
+
-
The request format has not changed.
+
-
:
+
-
In pre-0.3a5 versions the response had the form:
+
-
:
+
-
<source lang="javascript">
+
-
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":7,
+
-
                            "type":"line",
+
-
                            "line":2,
+
-
                            "target":"http://www.google.ca//event/seq/1"
+
-
                        }]
+
-
        },
+
-
  "running":true,
+
-
  "success":true
+
-
}
+
-
</source>
+
-
:
+
-
The following has changed:
+
-
*the <code>body</code> object no longer supports the <code>context_id</code> entry
+
-
*the <code>breakpoints</code> object contains <code>breakpoint</code> object entires that support the new <code>handle</code> and <code>location</code> object entries
+
-
 
+
-
<source lang="javascript">
+
-
Content-Length:1366
+
-
\r\n\r\n
+
-
{
+
-
  "type":"response",
+
-
  "command":"getbreakpoints",
+
-
  "seq":46,
+
-
  "request_seq":45,
+
-
  "body":{
+
-
          "breakpoints":[{
+
-
                            "handle":7,
+
-
                            "type":"line",
+
-
                            "location":{
+
-
                                        "line":2,
+
-
                                        "url":"http://www.google.ca//event/seq/1"
+
-
                                      },
+
-
                            "enabled":true
+
-
                        }]
+
-
        },
+
-
  "running":true,
+
-
  "success":true
+
-
}
+
-
</source>
+
-
 
+
-
== setbreakpoint ==
+
-
The <code>setbreakpoint</code> [[Crossfire_Protocol_Reference#setbreakpoint|request]] has been updated to accept new arguments; <code>enabled</code> and <code>condition</code>, and too make use of the new breakpoint <code>location</code> object.
+
-
:
+
-
The related work item is: [http://code.google.com/p/fbug/issues/detail?id=3928 Issue 3928]
+
-
:
+
-
'''Action Required'''
+
-
:
+
-
The following changes require clients to discontinue using the two removed arguments; <code>target</code> and <code>line</code>, and to begin using the new <code>location</code> object. Clients can also optionally use the <code>enabled</code> and <code>condition</code> arguments.
+
-
:
+
-
'''Details'''
+
-
:
+
-
In pre-0.3a5 versions the request you send had the form:
+
-
:
+
-
<source lang="javascript">
+
-
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
+
-
</source>
+
-
:
+
-
The following has changed:
+
-
*the <code>arguments</code> object no longer supports the <code>target</code> or <code>line</code> entry
+
-
*the <code>arguments</code> object now supports the <code>location</code> object and optionally the <code>enabled</code> and <code>condition</code> entries
+
-
:
+
-
New request form:
+
-
<source lang="javascript">
+
-
Content-Length:196
+
-
\r\n\r\n
+
-
{
+
-
  "type":"request",
+
-
  "command":"setbreakpoint",
+
-
  "context_id":"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
+
-
</source>
+
-
:
+
-
In pre-0.3a5 versions the response you get had the form:
+
-
:
+
-
<source lang="javascript">
+
-
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,
+
-
}
+
-
</source>
+
-
:
+
-
The following has changed:
+
-
*the <code>body</code> object no longer contains the <code>context_id</code> entry
+
-
*the <code>breakpoint</code> object no longer contains the <code>target</code> or <code>line</code> entry
+
-
*the <code>breakpoint</code> object now supports the <code>location</code> object and optionally the <code>enabled</code> and <code>condition</code> enties
+
-
:
+
-
New response form:
+
-
<source lang="javascript">
+
-
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
+
-
}
+
-
</source>
+
-
 
+
-
== updatecontext ==
+
-
 
+
-
The <code>updatecontext</code> request has been added to the protocol in 0.3a5 and allows you to load a new URL into an existing context.
+
-
:
+
-
The related work item is: [http://code.google.com/p/fbug/issues/detail?id=3841 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 [[Crossfire Protocol Reference#updatecontext|protocol reference]] page.
+
-
 
+
-
== onScript ==
+
-
 
+
-
The <code>onScript</code> [[Crossfire_Protocol_Reference#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: [http://code.google.com/p/fbug/issues/detail?id=3476 Issue 3476]
+
-
:
+
-
'''Action Required'''
+
-
:
+
-
The following changes require clients to discontinue using two removed attributes; <code>href</code> and <code>context_href</code> and begin using the new <code>script</code> object.
+
-
:
+
-
'''Details'''
+
-
:
+
-
In the pre-0.3a5 versions of Crossfire the <code>onScript</code> event had the following form:
+
-
:
+
-
<source lang="javascript">
+
-
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"
+
-
        }
+
-
}
+
-
</source>
+
-
:
+
-
The following has changed:
+
-
* the <code>body</code> object no longer contains an <code>href</code> and <code>context_href</code> enties
+
-
* the <code>body</code> object now contains the <code>script</code> meta-data object, identical to what is returned via a [[Crossfire_Protocol_Reference#script|script]] request with no included source.
+
-
:
+
-
New event form:
+
-
:
+
-
<source lang="javascript">
+
-
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"
+
-
                    }
+
-
          }
+
-
}
+
-
</source>
+
-
:
+
-
The values and kinds of the <code>script</code> object are as follows:
+
-
:
+
-
{| border="1" cellpadding="5" cellspacing="0"
+
-
|-
+
-
| <code>id</code> || a String identifier for the script - never null
+
-
|-
+
-
| <code>lineOffset</code> || a Number representing the line offset of the script - never less than 0
+
-
|-
+
-
| <code>columnOffset</code> || a Number representing the column offset of the script - never less than 0
+
-
|-
+
-
| <code>sourceStart</code> || a String representing the first line of source in the script - never null
+
-
|-
+
-
| <code>sourceLength</code> || a Number representing the entire length of the source of the script - never less than 0
+
-
|-
+
-
| <code>lineCount</code> || a Number representing the total number of lines of source in the script - never less than 0
+
-
|-
+
-
| <code>compilationType</code> || a String describing the kind of the script - see [http://code.google.com/p/fbug/source/browse/branches/firebug1.7/content/firebug/sourceFile.js sourceFile.js] for complete listing of types
+
-
|}
+
-
 
+
-
== onToggleBreakpoint ==
+
-
The <code>onToggleBreakpoint</code> [[Crossfire_Protocol_Reference#onToggleBreakpoint|event]] has been updated to reflect the new location object for breakpoints and to return a more complete set of breakpoint information.
+
-
:
+
-
The related work item is: [http://code.google.com/p/fbug/issues/detail?id=3928 Issue 3928]
+
-
:
+
-
'''Action Required'''
+
-
:
+
-
The following changes require clients to discontinue using two removed attributes; <code>url</code> and <code>line</code>, and to begin using the new <code>location</code> object.
+
-
:
+
-
'''Details'''
+
-
:
+
-
In the pre-0.3a5 versions the <code>onToggleBreakpoint</code> event had the following form:
+
-
:
+
-
<source lang="javascript">
+
-
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
+
-
        }
+
-
}
+
-
</source>
+
-
:
+
-
The following has changed:
+
-
*the <code>body</code> object no longer supports the <code>url</code> and <code>line</code> entries
+
-
*the <code>body</code> object now supports the <code>location</code> object to describe the locale of the breakpoint
+
-
*the <code>body</code> object now supports the <code>handle</code> entry, which is the Crossfire handle for the breakpoint
+
-
:
+
-
New event form:
+
-
:
+
-
<source lang="javascript">
+
-
Content-Length:150
+
-
\r\n\r\n
+
-
{
+
-
  "seq":26,
+
-
  "type":"event",
+
-
  "event":"onToggleBreakpoint",
+
-
  "context_id":"xf0.3::7640268",
+
-
  "data":{
+
-
          "handle":4,
+
-
          "set":false,
+
-
          "location":{
+
-
                        "line":2,
+
-
                        "url":"http://www.google.ca//event/seq/1"
+
-
                      }
+
-
        }
+
-
}
+
-
</source>
+
-
:
+
-
The values and kinds of the <code>data</code> object are as follows:
+
-
:
+
-
{| border="1" cellpadding="5" cellspacing="0"
+
-
|-
+
-
| <code>handle</code> || a Number identifier for the breakpoint - never less than 1
+
-
|-
+
-
| <code>set</code> || a Boolean representing if the breakpoint has been set (true) or removed (false)
+
-
|-
+
-
| <code>location</code> || an Object representing the locale of the breakpoint
+
-
|}
+
-
 
+
-
== onToggleDomBreakpoint ==
+
-
The <code>onToggleDomBreakpoint</code> [[Crossfire_Protocol_Reference#onToggleDomBreakpoint|event]] has been added to the protocol in 0.3a5 and is sent
+
-
when a DOM element breakpoint is enabled or disabled
+
-
:
+
-
The related work item is: [http://code.google.com/p/fbug/issues/detail?id=3928 Issue 3928]
+
-
:
+
-
'''Action Required'''
+
-
:
+
-
None, unless you want to support the new event
+
-
:
+
-
'''Details'''
+
-
:
+
-
Details on the new request can be found on the [[Crossfire_Protocol_Reference#onToggleDomBreakpoint|reference]] page.
+

Latest revision as of 03:02, 15 May 2012

  1. REDIRECT 0.3a5 Migration on Github
Personal tools