Bug 1464747 - Doesn't set the parentID of frame when window.parent is same as window. r?jryans
In order to prevent infinite loop in toolbox, this patch will ignore setting the
parent id if window.parent is same as current window.
MozReview-Commit-ID: KMfGxtEfo6N
--- a/devtools/server/actors/tab.js
+++ b/devtools/server/actors/tab.js
@@ -780,17 +780,20 @@ TabActor.prototype = {
.getInterface(Ci.nsIWebProgress);
const window = webProgress.DOMWindow;
const id = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils)
.outerWindowID;
let parentID = undefined;
// Ignore the parent of the original document on non-e10s firefox,
// as we get the xul window as parent and don't care about it.
- if (window.parent && window != this._originalWindow) {
+ // Furthermore, ignore setting parentID when parent window is same as
+ // current window in order to deal with front end. e.g. toolbox will be fall
+ // into infinite loop due to recursive search with by using parent id.
+ if (window.parent && window.parent != window && window != this._originalWindow) {
parentID = window.parent
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils)
.outerWindowID;
}
return {
id,