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 139525 bbc2b4a574557c7180b18841d9df11cf9337d20f
parent 139524 8ab9e35fd41f1235ac5730743c093426e4f4ce8b
child 139526 4ac6c72b06c838aaabe8c8cb6c0a69047d23fc54
push id3911
push userakeybl@mozilla.com
push dateMon, 24 Jun 2013 20:17:26 +0000
treeherdermozilla-aurora@7e26ca8db92b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs863818
milestone24.0a1
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 = {};