Bug 1375573 - Part 2: Avoid creating an about:blank document in setupJSON() by creating a Window binding through exposing a getter for the inner window ID on nsIWebProgress; r=billm

This commit is contained in:
Ehsan Akhgari
2017-06-27 15:40:33 -04:00
parent 7e0287e273
commit d6c10457c0
4 changed files with 37 additions and 8 deletions

View File

@@ -72,15 +72,12 @@ var WebProgressListener = {
if (aWebProgress) {
let domWindowID = null;
try {
let utils = aWebProgress.DOMWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils);
domWindowID = utils.outerWindowID;
innerWindowID = utils.currentInnerWindowID;
domWindowID = aWebProgress.DOMWindowID;
innerWindowID = aWebProgress.innerDOMWindowID;
} catch (e) {
// If nsDocShell::Destroy has already been called, then we'll
// get NS_NOINTERFACE when trying to get the DOM window.
// If there is no current inner window, we'll get
// NS_ERROR_NOT_AVAILABLE.
// The DOM Window ID getters above may throw if the inner or outer
// windows aren't created yet or are destroyed at the time we're making
// this call but that isn't fatal so ignore the exceptions here.
}
aWebProgress = {