Bug 863818 - console.log messages don't appear in the Web Console when connecting to 'shell.xul' via Simulator; r=past
authorMihai Sucan <mihai.sucan@gmail.com>
Thu, 16 May 2013 22:54:40 +0300
changeset 143898 bbc2b4a574557c7180b18841d9df11cf9337d20f
parent 143897 8ab9e35fd41f1235ac5730743c093426e4f4ce8b
child 143899 4ac6c72b06c838aaabe8c8cb6c0a69047d23fc54
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs863818
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 863818 - console.log messages don't appear in the Web Console when connecting to 'shell.xul' via Simulator; r=past
toolkit/devtools/webconsole/dbg-webconsole-actors.js
--- a/toolkit/devtools/webconsole/dbg-webconsole-actors.js
+++ b/toolkit/devtools/webconsole/dbg-webconsole-actors.js
@@ -51,23 +51,36 @@ XPCOMUtils.defineLazyModuleGetter(this, 
  *        Optional, the parent actor.
  */
 function WebConsoleActor(aConnection, aParentActor)
 {
   this.conn = aConnection;
 
   if (aParentActor instanceof BrowserTabActor &&
       aParentActor.browser instanceof Ci.nsIDOMWindow) {
-    this._window = aParentActor.browser;
+    // 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;
+    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._actorPool = new ActorPool(this.conn);
   this.conn.addActorPool(this._actorPool);
 
   this._prefs = {};