From 0c199441d6233f22197ebd4e7d8513d38ef76129 Mon Sep 17 00:00:00 2001 From: Mark Hammond Date: Tue, 23 Sep 2014 09:18:00 +1000 Subject: [PATCH] Bug 1069033 - Make devtool's TabTarget be e10s friendly. r=past --- browser/devtools/framework/target.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/browser/devtools/framework/target.js b/browser/devtools/framework/target.js index d5f2191a03e6..ddaed54d1a53 100644 --- a/browser/devtools/framework/target.js +++ b/browser/devtools/framework/target.js @@ -220,6 +220,14 @@ TabTarget.prototype = { }, get window() { + // XXX - this is a footgun for e10s - there .contentWindow will be null, + // and even though .contentWindowAsCPOW *might* work, it will not work + // in all contexts. Consumers of .window need to be refactored to not + // rely on this. + if (Services.appinfo.processType != Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) { + Cu.reportError("The .window getter on devtools' |target| object isn't e10s friendly!\n" + + Error().stack); + } // Be extra careful here, since this may be called by HS_getHudByWindow // during shutdown. if (this._tab && this._tab.linkedBrowser) { @@ -542,7 +550,7 @@ TabWebProgressListener.prototype = { } // emit event if the top frame is navigating - if (this.target && this.target.window == progress.DOMWindow) { + if (progress.isTopLevel) { // Emit the event if the target is not remoted or store the payload for // later emission otherwise. if (this.target._client) {