Bug 1391218 - Fix 'getDocShellEnumerator is not a function' exception when closing the last tab in a window.
MozReview-Commit-ID: FUcCCljVClI
--- a/devtools/server/actors/chrome.js
+++ b/devtools/server/actors/chrome.js
@@ -99,18 +99,20 @@ Object.defineProperty(ChromeActor.protot
}
});
ChromeActor.prototype.observe = function (subject, topic, data) {
TabActor.prototype.observe.call(this, subject, topic, data);
if (!this.attached) {
return;
}
+
+ subject.QueryInterface(Ci.nsIDocShell);
+
if (topic == "chrome-webnavigation-create") {
- subject.QueryInterface(Ci.nsIDocShell);
this._onDocShellCreated(subject);
} else if (topic == "chrome-webnavigation-destroy") {
this._onDocShellDestroy(subject);
}
};
ChromeActor.prototype._attach = function () {
if (this.attached) {
--- a/devtools/server/actors/tab.js
+++ b/devtools/server/actors/tab.js
@@ -680,18 +680,20 @@ TabActor.prototype = {
},
observe(subject, topic, data) {
// Ignore any event that comes before/after the tab actor is attached
// That typically happens during firefox shutdown.
if (!this.attached) {
return;
}
+
+ subject.QueryInterface(Ci.nsIDocShell);
+
if (topic == "webnavigation-create") {
- subject.QueryInterface(Ci.nsIDocShell);
this._onDocShellCreated(subject);
} else if (topic == "webnavigation-destroy") {
this._onDocShellDestroy(subject);
}
},
_onDocShellCreated(docShell) {
// (chrome-)webnavigation-create is fired very early during docshell