Bug 1578624 - P11: Add a flag to ask the parent to not actually load the URI when opening a window, since we'll do it ourselves anyway. r=kmag

Differential Revision: https://phabricator.services.mozilla.com/D47867
This commit is contained in:
Matt Woodrow
2019-10-11 01:56:35 +00:00
parent d27f2f3cae
commit d90755519d
5 changed files with 35 additions and 26 deletions

View File

@@ -1612,6 +1612,7 @@
var aFocusUrlBar;
var aName;
var aCsp;
var aSkipLoad;
if (
arguments.length == 2 &&
typeof arguments[1] == "object" &&
@@ -1642,6 +1643,7 @@
aFocusUrlBar = params.focusUrlBar;
aName = params.name;
aCsp = params.csp;
aSkipLoad = params.skipLoad;
}
// all callers of loadOneTab need to pass a valid triggeringPrincipal.
@@ -1682,6 +1684,7 @@
focusUrlBar: aFocusUrlBar,
name: aName,
csp: aCsp,
skipLoad: aSkipLoad,
});
if (!bgLoad) {
this.selectedTab = tab;
@@ -2094,6 +2097,7 @@
sameProcessAsFrameLoader,
uriIsAboutBlank,
userContextId,
skipLoad,
} = {}) {
let b = document.createXULElement("browser");
// Use the JSM global to create the permanentKey, so that if the
@@ -2210,7 +2214,7 @@
// Prevent the superfluous initial load of a blank document
// if we're going to load something other than about:blank.
if (!uriIsAboutBlank) {
if (!uriIsAboutBlank || skipLoad) {
b.setAttribute("nodefaultsrc", "true");
}
@@ -2577,6 +2581,7 @@
recordExecution,
replayExecution,
csp,
skipLoad,
} = {}
) {
// all callers of addTab that pass a params object need to pass
@@ -2810,6 +2815,7 @@
name,
recordExecution,
replayExecution,
skipLoad,
});
}
@@ -2903,7 +2909,8 @@
// then let's just continue loading the page normally.
if (
!usingPreloadedContent &&
(!uriIsAboutBlank || !allowInheritPrincipal)
(!uriIsAboutBlank || !allowInheritPrincipal) &&
!skipLoad
) {
// pretend the user typed this so it'll be available till
// the document successfully loads