Bug 998898 - Fix webconsole exception on simulator. r=jryans
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 23 Apr 2014 06:45:38 -0700
changeset 198228 8685f4d027ea19acb48f46b2cc738124c1a358c3
parent 198227 c6e856383007bce5825e7509873631dd7237f830
child 198229 00ca4e6c5eddf3d881242d3a1cb6ccb38aed610c
push idunknown
push userunknown
push dateunknown
reviewersjryans
bugs998898
milestone31.0a1
Bug 998898 - Fix webconsole exception on simulator. r=jryans
toolkit/devtools/server/actors/webbrowser.js
--- a/toolkit/devtools/server/actors/webbrowser.js
+++ b/toolkit/devtools/server/actors/webbrowser.js
@@ -532,17 +532,19 @@ TabActor.prototype = {
            this.docShell.QueryInterface(Ci.nsIInterfaceRequestor)
                         .getInterface(Ci.nsIContentFrameMessageManager);
   },
 
   /**
    * Getter for the nsIMessageManager associated to the tab.
    */
   get messageManager() {
-    return this._chromeEventHandler;
+    return this.docShell
+      .QueryInterface(Ci.nsIInterfaceRequestor)
+      .getInterface(Ci.nsIContentFrameMessageManager);
   },
 
   /**
    * Getter for the tab's doc shell.
    */
   get docShell() {
     throw "The docShell getter should be implemented by a subclass of TabActor";
   },
@@ -1080,24 +1082,16 @@ BrowserTabActor.prototype.constructor = 
 Object.defineProperty(BrowserTabActor.prototype, "docShell", {
   get: function() {
     return this._browser.docShell;
   },
   enumerable: true,
   configurable: false
 });
 
-Object.defineProperty(BrowserTabActor.prototype, "messageManager", {
-  get: function() {
-    return this._browser.messageManager;
-  },
-  enumerable: true,
-  configurable: false
-});
-
 Object.defineProperty(BrowserTabActor.prototype, "title", {
   get: function() {
     let title = this.contentDocument.title || this._browser.contentTitle;
     // If contentTitle is empty (e.g. on a not-yet-restored tab), but there is a
     // tabbrowser (i.e. desktop Firefox, but not Fennec), we can use the label
     // as the title.
     if (!title && this._tabbrowser) {
       let tab = this._tabbrowser._getTabForContentWindow(this.window);