B2G/gecko/toolkit/devtools/webconsole/dbg-webconsole-actors.js
/**
 * The WebConsoleActor implements capabilities needed for the Web Console
 * feature.
 *
 * @constructor
 * @param object aConnection
 *        The connection to the client, DebuggerServerConnection.
 * @param object [aParentActor]
 *        Optional, the parent actor.
 */
The WebConsoleActor implements capabilities needed for the Web Console
feature.

@constructor
@param object aConnection
The connection to the client, DebuggerServerConnection.
@param object [aParentActor]
Optional, the parent actor.
The WebConsoleActor implements capabilities needed for the Web Console feature . @constructor @param object aConnection The connection to the client DebuggerServerConnection . @param object [ aParentActor ] Optional the parent actor .
function WebConsoleActor(aConnection, aParentActor)
{
  this.conn = aConnection;
  if (aParentActor instanceof BrowserTabActor &&
      aParentActor.browser instanceof Ci.nsIDOMWindow) {
     TODO: bug 802246 - b2g has only one tab actor, the shell.xul, which is
     not properly supported by the console actor - see bug for details.
     Below we work around the problem: selecting the shell.xul tab actor
     behaves as if the user picked the global console actor.
    this._window = aParentActor.browser;
    this._window = Services.wm.getMostRecentWindow("navigator:browser");
    this._isGlobalActor = true;
  }
  else if (aParentActor instanceof BrowserTabActor &&
           aParentActor.browser instanceof Ci.nsIDOMElement) {
     Firefox for desktop tab actor |this.browser| points to the xul:browser
     element.
    this._window = aParentActor.browser.contentWindow;
  }
  else {
     In all other cases we should behave as the global console actor.
    this._window = Services.wm.getMostRecentWindow("navigator:browser");
    this._isGlobalActor = true;
  }
  this._objectActorsPool = new ActorPool(this.conn);
  this.conn.addActorPool(this._objectActorsPool);
  this._networkEventActorsPool = new ActorPool(this.conn);
  this.conn.addActorPool(this._networkEventActorsPool);
  this._prefs = {};
}
function WebConsoleActor ( aConnection , aParentActor ) { this . conn = aConnection ; if ( aParentActor instanceof BrowserTabActor && aParentActor . browser instanceof Ci . nsIDOMWindow ) { this . _window = Services . wm . getMostRecentWindow ( "navigator:browser" ) ; this . _isGlobalActor = true ; } else if ( aParentActor instanceof BrowserTabActor && aParentActor . browser instanceof Ci . nsIDOMElement ) { this . _window = aParentActor . browser . contentWindow ; } else { this . _window = Services . wm . getMostRecentWindow ( "navigator:browser" ) ; this . _isGlobalActor = true ; } this . _objectActorsPool = new ActorPool ( this . conn ) ; this . conn . addActorPool ( this . _objectActorsPool ) ; this . _networkEventActorsPool = new ActorPool ( this . conn ) ; this . conn . addActorPool ( this . _networkEventActorsPool ) ; this . _prefs = { } ; }
The WebConsoleActor implements capabilities needed for the Web Console
 feature.
The WebConsoleActor implements capabilities needed for the Web Console feature .
// B2G tab actor |this.browser| points to a DOM chrome window, not // a xul:browser element. // // TODO: bug 802246 - b2g has only one tab actor, the shell.xul, which is // not properly supported by the console actor - see bug for details. // // Below we work around the problem: selecting the shell.xul tab actor // behaves as if the user picked the global console actor. //this._window = aParentActor.browser; // Firefox for desktop tab actor |this.browser| points to the xul:browser // element. // In all other cases we should behave as the global console actor.