B2G/gecko/browser/devtools/webconsole/webconsole.js
/**
   * Initialize a debugger client and connect it to the debugger server.
   *
   * @param function [aCallback]
   *        Optional function to invoke when connection is established.
   */
Initialize a debugger client and connect it to the debugger server.
@param function [aCallback]
Optional function to invoke when connection is established.
Initialize a debugger client and connect it to the debugger server . @param function [ aCallback ] Optional function to invoke when connection is established .
function WCCP_connect(aCallback)
  {
    let transport = DebuggerServer.connectPipe();
    let client = this.client = new DebuggerClient(transport);
    client.addListener("pageError", this._onPageError);
    client.addListener("consoleAPICall", this._onConsoleAPICall);
    client.addListener("networkEvent", this._onNetworkEvent);
    client.addListener("networkEventUpdate", this._onNetworkEventUpdate);
    client.addListener("fileActivity", this._onFileActivity);
    client.addListener("locationChange", this._onLocationChange);
    let listeners = ["PageError", "ConsoleAPI", "NetworkActivity",
                     "FileActivity", "LocationChange"];
    client.connect(function(aType, aTraits) {
      client.listTabs(function(aResponse) {
        let tab = aResponse.tabs[aResponse.selected];
        this._consoleActor = tab.consoleActor;
        this.owner.onLocationChange(tab.url, tab.title);
        client.attachConsole(tab.consoleActor, listeners,
                             this._onAttachConsole.bind(this, aCallback));
      }.bind(this));
    }.bind(this));
  }
function WCCP_connect ( aCallback ) { let transport = DebuggerServer . connectPipe ( ) ; let client = this . client = new DebuggerClient ( transport ) ; client . addListener ( "pageError" , this . _onPageError ) ; client . addListener ( "consoleAPICall" , this . _onConsoleAPICall ) ; client . addListener ( "networkEvent" , this . _onNetworkEvent ) ; client . addListener ( "networkEventUpdate" , this . _onNetworkEventUpdate ) ; client . addListener ( "fileActivity" , this . _onFileActivity ) ; client . addListener ( "locationChange" , this . _onLocationChange ) ; let listeners = [ "PageError" , "ConsoleAPI" , "NetworkActivity" , "FileActivity" , "LocationChange" ] ; client . connect ( function ( aType , aTraits ) { client . listTabs ( function ( aResponse ) { let tab = aResponse . tabs [ aResponse . selected ] ; this . _consoleActor = tab . consoleActor ; this . owner . onLocationChange ( tab . url , tab . title ) ; client . attachConsole ( tab . consoleActor , listeners , this . _onAttachConsole . bind ( this , aCallback ) ) ; } . bind ( this ) ) ; } . bind ( this ) ) ; }
Initialize a debugger client and connect it to the debugger server.
Initialize a debugger client and connect it to the debugger server .