Bug 1227139 - Fix the webconsole for addon and browser content toolbox by handling a missing performance property on this.window. r=bgrins

This commit is contained in:
Alexandre Poirot 2015-11-25 07:54:26 -08:00
parent 8d7f0946d5
commit e4a83f8b2f

View File

@ -158,8 +158,12 @@ WebConsoleActor.prototype =
}, },
/** /**
* The window we work with. * The window or sandbox we work with.
* @type nsIDOMWindow * Note that even if it is named `window` it refers to the current
* global we are debugging, which can be a Sandbox for addons
* or browser content toolbox.
*
* @type nsIDOMWindow or Sandbox
*/ */
get window() { get window() {
if (this.parentActor.isRootActor) { if (this.parentActor.isRootActor) {
@ -736,7 +740,8 @@ WebConsoleActor.prototype =
break; break;
} }
let requestStartTime = this.window ? // See `window` definition. It isn't always a DOM Window.
let requestStartTime = this.window && this.window.performance ?
this.window.performance.timing.requestStart : 0; this.window.performance.timing.requestStart : 0;
let cache = this.consoleAPIListener let cache = this.consoleAPIListener