mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-11 14:28:42 +00:00
Backed out 2 changesets (bug 1444760) for ES lint failure in /builds/worker/checkouts/gecko/browser/base/content/browser.js on a CLOSED TREE
Backed out changeset 71f61091a716 (bug 1444760) Backed out changeset 4956db1e9bdd (bug 1444760)
This commit is contained in:
parent
e2ed0b5dfb
commit
27703664b0
@ -1021,7 +1021,7 @@ function handleUriInChrome(aBrowser, aUri) {
|
||||
|
||||
// A shared function used by both remote and non-remote browser XBL bindings to
|
||||
// load a URI or redirect it to the correct process.
|
||||
function _loadURI(browser, uri, params = {}) {
|
||||
function _loadURIWithFlags(browser, uri, params) {
|
||||
let tab = gBrowser.getTabForBrowser(browser);
|
||||
// Preloaded browsers don't have tabs, so we ignore those.
|
||||
if (tab) {
|
||||
@ -1031,15 +1031,12 @@ function _loadURI(browser, uri, params = {}) {
|
||||
if (!uri) {
|
||||
uri = "about:blank";
|
||||
}
|
||||
|
||||
let {
|
||||
flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
|
||||
referrerURI,
|
||||
referrerPolicy = Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
triggeringPrincipal,
|
||||
postData,
|
||||
userContextId,
|
||||
} = params || {};
|
||||
let triggeringPrincipal = params.triggeringPrincipal || null;
|
||||
let flags = params.flags || 0;
|
||||
let referrer = params.referrerURI;
|
||||
let referrerPolicy = ("referrerPolicy" in params ? params.referrerPolicy :
|
||||
Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
|
||||
let postData = params.postData;
|
||||
|
||||
let currentRemoteType = browser.remoteType;
|
||||
let requiredRemoteType;
|
||||
@ -1085,12 +1082,12 @@ function _loadURI(browser, uri, params = {}) {
|
||||
}
|
||||
try {
|
||||
if (!mustChangeProcess) {
|
||||
if (userContextId) {
|
||||
browser.webNavigation.setOriginAttributesBeforeLoading({ userContextId });
|
||||
if (params.userContextId) {
|
||||
browser.webNavigation.setOriginAttributesBeforeLoading({ userContextId: params.userContextId });
|
||||
}
|
||||
|
||||
browser.webNavigation.loadURIWithOptions(uri, flags,
|
||||
referrerURI, referrerPolicy,
|
||||
referrer, referrerPolicy,
|
||||
postData, null, null, triggeringPrincipal);
|
||||
} else {
|
||||
// Check if the current browser is allowed to unload.
|
||||
@ -1109,15 +1106,15 @@ function _loadURI(browser, uri, params = {}) {
|
||||
? gSerializationHelper.serializeToString(triggeringPrincipal)
|
||||
: null,
|
||||
flags,
|
||||
referrer: referrerURI ? referrerURI.spec : null,
|
||||
referrer: referrer ? referrer.spec : null,
|
||||
referrerPolicy,
|
||||
remoteType: requiredRemoteType,
|
||||
postData,
|
||||
newFrameloader,
|
||||
};
|
||||
|
||||
if (userContextId) {
|
||||
loadParams.userContextId = userContextId;
|
||||
if (params.userContextId) {
|
||||
loadParams.userContextId = params.userContextId;
|
||||
}
|
||||
|
||||
LoadInOtherProcess(browser, loadParams);
|
||||
@ -1132,11 +1129,11 @@ function _loadURI(browser, uri, params = {}) {
|
||||
Cu.reportError(e);
|
||||
gBrowser.updateBrowserRemotenessByURL(browser, uri);
|
||||
|
||||
if (userContextId) {
|
||||
browser.webNavigation.setOriginAttributesBeforeLoading({ userContextId: userContextId });
|
||||
if (params.userContextId) {
|
||||
browser.webNavigation.setOriginAttributesBeforeLoading({ userContextId: params.userContextId });
|
||||
}
|
||||
|
||||
browser.webNavigation.loadURIWithOptions(uri, flags, referrerURI, referrerPolicy,
|
||||
browser.webNavigation.loadURIWithOptions(uri, flags, referrer, referrerPolicy,
|
||||
postData, null, null, triggeringPrincipal);
|
||||
} else {
|
||||
throw e;
|
||||
@ -3174,9 +3171,9 @@ var BrowserOnClick = {
|
||||
// Allow users to override and continue through to the site,
|
||||
// but add a notify bar as a reminder, so that they don't lose
|
||||
// track after, e.g., tab switching.
|
||||
gBrowser.loadURI(gBrowser.currentURI.spec, {
|
||||
flags: Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CLASSIFIER,
|
||||
});
|
||||
gBrowser.loadURIWithFlags(gBrowser.currentURI.spec,
|
||||
Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CLASSIFIER,
|
||||
null, null, null);
|
||||
|
||||
Services.perms.add(gBrowser.currentURI, "safe-browsing",
|
||||
Ci.nsIPermissionManager.ALLOW_ACTION,
|
||||
@ -3299,13 +3296,13 @@ function BrowserReloadWithFlags(reloadFlags) {
|
||||
// If the remoteness has changed, the new browser doesn't have any
|
||||
// information of what was loaded before, so we need to load the previous
|
||||
// URL again.
|
||||
gBrowser.loadURI(url, { flags: reloadFlags });
|
||||
gBrowser.loadURIWithFlags(url, reloadFlags);
|
||||
return;
|
||||
}
|
||||
|
||||
// Do this after the above case where we might flip remoteness.
|
||||
// Unfortunately, we'll count the remoteness flip case as a
|
||||
// "newURL" load, since we're using loadURI, but hopefully
|
||||
// "newURL" load, since we're using loadURIWithFlags, but hopefully
|
||||
// that's rare enough to not matter.
|
||||
maybeRecordAbandonmentTelemetry(gBrowser.selectedTab, "reload");
|
||||
|
||||
@ -5343,8 +5340,8 @@ nsBrowserAccess.prototype = {
|
||||
let loadflags = isExternal ?
|
||||
Ci.nsIWebNavigation.LOAD_FLAGS_FROM_EXTERNAL :
|
||||
Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
|
||||
gBrowser.loadURI(aURI.spec, {
|
||||
triggeringPrincipal: aTriggeringPrincipal,
|
||||
gBrowser.loadURIWithFlags(aURI.spec, {
|
||||
aTriggeringPrincipal,
|
||||
flags: loadflags,
|
||||
referrerURI: referrer,
|
||||
referrerPolicy,
|
||||
|
@ -120,7 +120,7 @@ window._gBrowser = {
|
||||
*/
|
||||
_browserBindingProperties: [
|
||||
"canGoBack", "canGoForward", "goBack", "goForward", "permitUnload",
|
||||
"reload", "reloadWithFlags", "stop", "loadURI",
|
||||
"reload", "reloadWithFlags", "stop", "loadURI", "loadURIWithFlags",
|
||||
"gotoIndex", "currentURI", "documentURI",
|
||||
"preferences", "imageDocument", "isRemoteBrowser", "messageManager",
|
||||
"getTabBrowser", "finder", "fastFind", "sessionHistory", "contentTitle",
|
||||
@ -346,8 +346,20 @@ window._gBrowser = {
|
||||
/**
|
||||
* throws exception for unknown schemes
|
||||
*/
|
||||
loadURI(aURI, aParams) {
|
||||
return this.selectedBrowser.loadURI(aURI, aParams);
|
||||
loadURI(aURI, aReferrerURI, aCharset) {
|
||||
return this.selectedBrowser.loadURI(aURI, aReferrerURI, aCharset);
|
||||
},
|
||||
|
||||
/**
|
||||
* throws exception for unknown schemes
|
||||
*/
|
||||
loadURIWithFlags(aURI, aFlags, aReferrerURI, aCharset, aPostData) {
|
||||
// Note - the callee understands both:
|
||||
// (a) loadURIWithFlags(aURI, aFlags, ...)
|
||||
// (b) loadURIWithFlags(aURI, { flags: aFlags, ... })
|
||||
// Forwarding it as (a) here actually supports both (a) and (b),
|
||||
// so you can call us either way too.
|
||||
return this.selectedBrowser.loadURIWithFlags(aURI, aFlags, aReferrerURI, aCharset, aPostData);
|
||||
},
|
||||
|
||||
gotoIndex(aIndex) {
|
||||
@ -1486,7 +1498,7 @@ window._gBrowser = {
|
||||
Ci.nsIWebNavigation.LOAD_FLAGS_FIXUP_SCHEME_TYPOS;
|
||||
}
|
||||
try {
|
||||
browser.loadURI(aURIs[0], {
|
||||
browser.loadURIWithFlags(aURIs[0], {
|
||||
flags,
|
||||
postData: aPostDatas[0],
|
||||
triggeringPrincipal: aTriggeringPrincipal,
|
||||
@ -2419,7 +2431,7 @@ window._gBrowser = {
|
||||
if (aDisallowInheritPrincipal)
|
||||
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_DISALLOW_INHERIT_PRINCIPAL;
|
||||
try {
|
||||
b.loadURI(aURI, {
|
||||
b.loadURIWithFlags(aURI, {
|
||||
flags,
|
||||
triggeringPrincipal: aTriggeringPrincipal,
|
||||
referrerURI: aNoReferrer ? null : aReferrerURI,
|
||||
@ -4704,3 +4716,4 @@ var StatusPanel = {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -2311,12 +2311,24 @@
|
||||
<field name="tabModalPromptBox">null</field>
|
||||
|
||||
<!-- throws exception for unknown schemes -->
|
||||
<method name="loadURI">
|
||||
<method name="loadURIWithFlags">
|
||||
<parameter name="aURI"/>
|
||||
<parameter name="aParams"/>
|
||||
<parameter name="aFlags"/>
|
||||
<parameter name="aReferrerURI"/>
|
||||
<parameter name="aCharset"/>
|
||||
<parameter name="aPostData"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
_loadURI(this, aURI, aParams);
|
||||
var params = arguments[1];
|
||||
if (typeof(params) == "number") {
|
||||
params = {
|
||||
flags: aFlags,
|
||||
referrerURI: aReferrerURI,
|
||||
charset: aCharset,
|
||||
postData: aPostData,
|
||||
};
|
||||
}
|
||||
_loadURIWithFlags(this, aURI, params);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
@ -2329,12 +2341,24 @@
|
||||
<field name="tabModalPromptBox">null</field>
|
||||
|
||||
<!-- throws exception for unknown schemes -->
|
||||
<method name="loadURI">
|
||||
<method name="loadURIWithFlags">
|
||||
<parameter name="aURI"/>
|
||||
<parameter name="aParams"/>
|
||||
<parameter name="aFlags"/>
|
||||
<parameter name="aReferrerURI"/>
|
||||
<parameter name="aCharset"/>
|
||||
<parameter name="aPostData"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
_loadURI(this, aURI, aParams);
|
||||
var params = arguments[1];
|
||||
if (typeof(params) == "number") {
|
||||
params = {
|
||||
flags: aFlags,
|
||||
referrerURI: aReferrerURI,
|
||||
charset: aCharset,
|
||||
postData: aPostData,
|
||||
};
|
||||
}
|
||||
_loadURIWithFlags(this, aURI, params);
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -77,7 +77,7 @@ var waitForLoad = async function(uri) {
|
||||
// Waits for a load and updates the known history
|
||||
var waitForLoadWithFlags = async function(uri, flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE) {
|
||||
info("Loading " + uri + " flags = " + flags);
|
||||
gBrowser.selectedBrowser.loadURI(uri, { flags });
|
||||
gBrowser.selectedBrowser.loadURIWithFlags(uri, flags, null, null, null);
|
||||
|
||||
await BrowserTestUtils.browserStopped(gBrowser);
|
||||
if (!(flags & Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY)) {
|
||||
|
@ -448,7 +448,7 @@ function openLinkIn(url, where, params) {
|
||||
targetBrowser.createAboutBlankContentViewer(aPrincipal);
|
||||
}
|
||||
|
||||
targetBrowser.loadURI(url, {
|
||||
targetBrowser.loadURIWithFlags(url, {
|
||||
triggeringPrincipal: aTriggeringPrincipal,
|
||||
flags,
|
||||
referrerURI: aNoReferrer ? null : aReferrerURI,
|
||||
|
@ -108,6 +108,6 @@ function loadPanel(extensionId, extensionUrl, browserStyle) {
|
||||
getBrowser(sidebar).then(browser => {
|
||||
let uri = Services.io.newURI(policy.getURL());
|
||||
let triggeringPrincipal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
|
||||
browser.loadURI(extensionUrl, {triggeringPrincipal});
|
||||
browser.loadURIWithFlags(extensionUrl, {triggeringPrincipal});
|
||||
});
|
||||
}
|
||||
|
@ -316,7 +316,7 @@ class BasePopup {
|
||||
stylesheets: this.STYLESHEETS,
|
||||
});
|
||||
|
||||
browser.loadURI(popupURL, {triggeringPrincipal: this.extension.principal});
|
||||
browser.loadURIWithFlags(popupURL, {triggeringPrincipal: this.extension.principal});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -278,7 +278,7 @@ class ParentDevToolsPanel {
|
||||
},
|
||||
});
|
||||
|
||||
browser.loadURI(url, {
|
||||
browser.loadURIWithFlags(url, {
|
||||
triggeringPrincipal: extension.principal,
|
||||
});
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ class DevToolsPage extends HiddenExtensionPage {
|
||||
},
|
||||
});
|
||||
|
||||
this.browser.loadURI(this.url, {
|
||||
this.browser.loadURIWithFlags(this.url, {
|
||||
triggeringPrincipal: this.extension.principal,
|
||||
});
|
||||
|
||||
|
@ -614,7 +614,7 @@ this.tabs = class extends ExtensionAPI {
|
||||
: Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
|
||||
triggeringPrincipal: context.principal,
|
||||
};
|
||||
nativeTab.linkedBrowser.loadURI(url, options);
|
||||
nativeTab.linkedBrowser.loadURIWithFlags(url, options);
|
||||
}
|
||||
|
||||
if (updateProperties.active !== null) {
|
||||
|
@ -58,9 +58,8 @@ function replaceUrlInTab(gBrowser, tab, url) {
|
||||
},
|
||||
});
|
||||
});
|
||||
gBrowser.loadURI(url, {
|
||||
flags: Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY,
|
||||
});
|
||||
gBrowser.loadURIWithFlags(
|
||||
url, {flags: Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY});
|
||||
return loaded;
|
||||
}
|
||||
|
||||
|
@ -33,10 +33,10 @@ function checkTelemetryRecords(expectedValue) {
|
||||
function promiseStoppedLoad(expectedURL) {
|
||||
return new Promise(resolve => {
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
let original = browser.loadURI;
|
||||
browser.loadURI = function(URI) {
|
||||
let original = browser.loadURIWithFlags;
|
||||
browser.loadURIWithFlags = function(URI) {
|
||||
if (URI == expectedURL) {
|
||||
browser.loadURI = original;
|
||||
browser.loadURIWithFlags = original;
|
||||
ok(true, "loaded expected url: " + URI);
|
||||
resolve();
|
||||
return;
|
||||
|
@ -2901,7 +2901,7 @@ var SessionStoreInternal = {
|
||||
// a flash of the about:tabcrashed page after selecting
|
||||
// the revived tab.
|
||||
aTab.removeAttribute("crashed");
|
||||
browser.loadURI("about:blank");
|
||||
browser.loadURI("about:blank", null, null);
|
||||
|
||||
let data = TabState.collect(aTab);
|
||||
this.restoreTab(aTab, data, {
|
||||
|
@ -17,7 +17,7 @@ add_task(async function() {
|
||||
|
||||
// Load a new URI with a specific referrer.
|
||||
let referrerURI = Services.io.newURI(REFERRER1);
|
||||
browser.loadURI("http://example.org", { referrerURI });
|
||||
browser.loadURI("http://example.org", referrerURI, null);
|
||||
await promiseBrowserLoaded(browser);
|
||||
|
||||
await TabStateFlusher.flush(browser);
|
||||
|
@ -12,7 +12,7 @@ let notificationsCount = 0;
|
||||
async function openWindow(url) {
|
||||
let win = await promiseNewWindowLoaded();
|
||||
let flags = Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;
|
||||
win.gBrowser.selectedBrowser.loadURI(url, { flags });
|
||||
win.gBrowser.selectedBrowser.loadURIWithFlags(url, flags);
|
||||
await promiseBrowserLoaded(win.gBrowser.selectedBrowser, true, url);
|
||||
return win;
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ let notificationsCount = 0;
|
||||
async function openWindow(url) {
|
||||
let win = await promiseNewWindowLoaded();
|
||||
let flags = Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;
|
||||
win.gBrowser.selectedBrowser.loadURI(url, { flags });
|
||||
win.gBrowser.selectedBrowser.loadURIWithFlags(url, flags);
|
||||
await promiseBrowserLoaded(win.gBrowser.selectedBrowser, true, url);
|
||||
return win;
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ add_task(async function test() {
|
||||
|
||||
// Load some URL in the current tab.
|
||||
let flags = Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;
|
||||
win.gBrowser.selectedBrowser.loadURI("about:robots", { flags });
|
||||
win.gBrowser.selectedBrowser.loadURIWithFlags("about:robots", flags);
|
||||
await promiseBrowserLoaded(win.gBrowser.selectedBrowser);
|
||||
|
||||
// Open a second tab and close the first one.
|
||||
|
@ -17,7 +17,7 @@ async function openAndCloseTab(window, url) {
|
||||
async function openWindow(url) {
|
||||
let win = await promiseNewWindowLoaded();
|
||||
let flags = Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;
|
||||
win.gBrowser.selectedBrowser.loadURI(url, { flags });
|
||||
win.gBrowser.selectedBrowser.loadURIWithFlags(url, flags);
|
||||
await promiseBrowserLoaded(win.gBrowser.selectedBrowser, true, url);
|
||||
return win;
|
||||
}
|
||||
|
@ -239,9 +239,9 @@ var ContentSearch = {
|
||||
// Since we're going to load the search in the same browser, blur the search
|
||||
// UI to prevent further interaction before we start loading.
|
||||
this._reply(msg, "Blur");
|
||||
browser.loadURI(submission.uri.spec, {
|
||||
postData: submission.postData
|
||||
});
|
||||
browser.loadURIWithFlags(submission.uri.spec,
|
||||
Ci.nsIWebNavigation.LOAD_FLAGS_NONE, null, null,
|
||||
submission.postData);
|
||||
} else {
|
||||
let params = {
|
||||
postData: submission.postData,
|
||||
|
@ -167,7 +167,7 @@ add_task(async function() {
|
||||
|
||||
store.dispatch(Actions.batchEnable(false));
|
||||
|
||||
tab.linkedBrowser.loadURI(TOP_URL);
|
||||
tab.linkedBrowser.loadURI(TOP_URL, null, null);
|
||||
|
||||
await waitForNetworkEvents(monitor, REQUEST_COUNT);
|
||||
|
||||
|
@ -124,7 +124,7 @@ function swapToInnerBrowser({ tab, containerURL, getInnerBrowser }) {
|
||||
});
|
||||
// Prevent the `containerURL` from ending up in the tab's history.
|
||||
debug("Load container URL");
|
||||
containerBrowser.loadURI(containerURL, {
|
||||
containerBrowser.loadURIWithFlags(containerURL, {
|
||||
flags: Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY,
|
||||
});
|
||||
|
||||
|
@ -315,7 +315,7 @@ function waitForViewportLoad(ui) {
|
||||
|
||||
function load(browser, url) {
|
||||
let loaded = BrowserTestUtils.browserLoaded(browser, false, url);
|
||||
browser.loadURI(url);
|
||||
browser.loadURI(url, null, null);
|
||||
return loaded;
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@ add_task(async function test_dataURI_unique_opaque_origin() {
|
||||
let pagePrincipal = browser.contentPrincipal;
|
||||
info("pagePrincial " + pagePrincipal.origin);
|
||||
|
||||
browser.loadURI("data:text/html,hi");
|
||||
browser.loadURIWithFlags("data:text/html,hi", 0, null, null, null);
|
||||
await BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
await ContentTask.spawn(browser, { principal: pagePrincipal }, async function(args) {
|
||||
|
@ -22,7 +22,7 @@ function startTest() {
|
||||
BrowserTestUtils.browserLoaded(browser, false, url).then(() => {
|
||||
func();
|
||||
});
|
||||
browser.loadURI(url, { flags });
|
||||
browser.loadURIWithFlags(url, flags, null, null, null);
|
||||
}
|
||||
|
||||
// Load a normal http URL
|
||||
@ -68,3 +68,4 @@ function startTest() {
|
||||
|
||||
nextTest();
|
||||
}
|
||||
|
||||
|
@ -20,9 +20,7 @@ function test() {
|
||||
postStream.addHeader("Content-Type", "application/x-www-form-urlencoded");
|
||||
postStream.setData(dataStream);
|
||||
|
||||
tab.linkedBrowser.loadURI("http://mochi.test:8888/browser/docshell/test/browser/print_postdata.sjs", {
|
||||
postData: postStream,
|
||||
});
|
||||
tab.linkedBrowser.loadURIWithFlags("http://mochi.test:8888/browser/docshell/test/browser/print_postdata.sjs", 0, null, null, postStream);
|
||||
BrowserTestUtils.browserLoaded(tab.linkedBrowser).then(() => {
|
||||
ContentTask.spawn(tab.linkedBrowser, gPostData, function(postData) {
|
||||
var bodyText = content.document.body.textContent;
|
||||
|
@ -1172,12 +1172,7 @@ var BrowserApp = {
|
||||
}
|
||||
|
||||
try {
|
||||
aBrowser.loadURI(aURI, {
|
||||
flags,
|
||||
referrerURI,
|
||||
charset,
|
||||
postData,
|
||||
});
|
||||
aBrowser.loadURIWithFlags(aURI, flags, referrerURI, charset, postData);
|
||||
} catch(e) {
|
||||
if (tab) {
|
||||
let message = {
|
||||
@ -3497,7 +3492,7 @@ nsBrowserAccess.prototype = {
|
||||
}
|
||||
|
||||
let openerWindow = (aFlags & Ci.nsIBrowserDOMWindow.OPEN_NO_OPENER) ? null : aOpener;
|
||||
// BrowserApp.addTab calls loadURI with the appropriate params
|
||||
// BrowserApp.addTab calls loadURIWithFlags with the appropriate params
|
||||
let tab = BrowserApp.addTab(aURI ? aURI.spec : "about:blank", { flags: loadflags,
|
||||
referrerURI: referrer,
|
||||
external: isExternal,
|
||||
@ -3514,7 +3509,7 @@ nsBrowserAccess.prototype = {
|
||||
// OPEN_CURRENTWINDOW and illegal values
|
||||
let browser = BrowserApp.selectedBrowser;
|
||||
if (aURI && browser) {
|
||||
browser.loadURI(aURI.spec, {
|
||||
browser.loadURIWithFlags(aURI.spec, {
|
||||
flags: loadflags,
|
||||
referrerURI: referrer,
|
||||
triggeringPrincipal: aTriggeringPrincipal,
|
||||
@ -3780,12 +3775,7 @@ Tab.prototype = {
|
||||
this.isSearch = "isSearch" in aParams ? aParams.isSearch : false;
|
||||
|
||||
try {
|
||||
this.browser.loadURI(aURL, {
|
||||
flags,
|
||||
referrerURI,
|
||||
charset,
|
||||
postData,
|
||||
});
|
||||
this.browser.loadURIWithFlags(aURL, flags, referrerURI, charset, postData);
|
||||
} catch(e) {
|
||||
let message = {
|
||||
type: "Content:LoadError",
|
||||
|
@ -75,10 +75,9 @@ class GeckoViewNavigation extends GeckoViewModule {
|
||||
navFlags |= Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_POPUPS;
|
||||
}
|
||||
|
||||
this.browser.loadURI(uri, {
|
||||
flags: navFlags,
|
||||
referrerURI: referrer,
|
||||
});
|
||||
this.browser.loadURIWithFlags(uri, navFlags, referrer || null,
|
||||
baseUri ? Services.io.newURI(baseUri) : null,
|
||||
/* nsIPrincipal */ null);
|
||||
break;
|
||||
case "GeckoView:Reload":
|
||||
this.browser.reload();
|
||||
|
@ -321,9 +321,7 @@ function startAndLoadURI(pageName) {
|
||||
|
||||
start_time = Date.now();
|
||||
if (loadNoCache) {
|
||||
content.loadURI(pageName, {
|
||||
flags: Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE
|
||||
});
|
||||
content.loadURIWithFlags(pageName, Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE);
|
||||
} else {
|
||||
content.loadURI(pageName);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ class BackgroundPage extends HiddenExtensionPage {
|
||||
|
||||
extensions.emit("extension-browser-inserted", this.browser);
|
||||
|
||||
this.browser.loadURI(this.url, {triggeringPrincipal: this.extension.principal});
|
||||
this.browser.loadURIWithFlags(this.url, {triggeringPrincipal: this.extension.principal});
|
||||
|
||||
let context = await promiseExtensionViewLoaded(this.browser);
|
||||
TelemetryStopwatch.finish("WEBEXT_BACKGROUND_PAGE_LOAD_MS", this);
|
||||
|
@ -103,25 +103,52 @@
|
||||
<!-- throws exception for unknown schemes -->
|
||||
<method name="loadURI">
|
||||
<parameter name="aURI"/>
|
||||
<parameter name="aParams"/>
|
||||
<parameter name="aReferrerURI"/>
|
||||
<parameter name="aCharset"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!aURI) {
|
||||
aURI = "about:blank";
|
||||
}
|
||||
const nsIWebNavigation = Ci.nsIWebNavigation;
|
||||
const flags = nsIWebNavigation.LOAD_FLAGS_NONE;
|
||||
this._wrapURIChangeCall(() =>
|
||||
this.loadURIWithFlags(aURI, flags, aReferrerURI, aCharset));
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
let {
|
||||
flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
|
||||
referrerURI,
|
||||
referrerPolicy = Ci.nsIHttpChannel.REFERRER_POLICY_UNSET,
|
||||
triggeringPrincipal,
|
||||
postData,
|
||||
} = aParams || {};
|
||||
<!-- throws exception for unknown schemes -->
|
||||
<method name="loadURIWithFlags">
|
||||
<parameter name="aURI"/>
|
||||
<parameter name="aFlags"/>
|
||||
<parameter name="aReferrerURI"/>
|
||||
<parameter name="aCharset"/>
|
||||
<parameter name="aPostData"/>
|
||||
<body>
|
||||
<![CDATA[
|
||||
if (!aURI)
|
||||
aURI = "about:blank";
|
||||
|
||||
var aReferrerPolicy = Ci.nsIHttpChannel.REFERRER_POLICY_UNSET;
|
||||
var aTriggeringPrincipal;
|
||||
|
||||
// Check for loadURIWithFlags(uri, { ... });
|
||||
var params = arguments[1];
|
||||
if (params && typeof(params) == "object") {
|
||||
aFlags = params.flags;
|
||||
aReferrerURI = params.referrerURI;
|
||||
if ("referrerPolicy" in params) {
|
||||
aReferrerPolicy = params.referrerPolicy;
|
||||
}
|
||||
if ("triggeringPrincipal" in params) {
|
||||
aTriggeringPrincipal = params.triggeringPrincipal;
|
||||
}
|
||||
aCharset = params.charset;
|
||||
aPostData = params.postData;
|
||||
}
|
||||
|
||||
this._wrapURIChangeCall(() =>
|
||||
this.webNavigation.loadURIWithOptions(
|
||||
aURI, flags, referrerURI, referrerPolicy,
|
||||
postData, null, null, triggeringPrincipal));
|
||||
aURI, aFlags, aReferrerURI, aReferrerPolicy,
|
||||
aPostData, null, null, aTriggeringPrincipal));
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
@ -2220,7 +2220,7 @@ var gDiscoverView = {
|
||||
if (!aKeepHistory)
|
||||
flags |= Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY;
|
||||
|
||||
this._browser.loadURI(aURL, { flags });
|
||||
this._browser.loadURIWithFlags(aURL, flags);
|
||||
},
|
||||
|
||||
onLocationChange(aWebProgress, aRequest, aLocation, aFlags) {
|
||||
|
@ -56,7 +56,7 @@
|
||||
// 6) Start reloading first tab.
|
||||
function loadFirstTab() {
|
||||
var browser = document.getElementById("tab1browser");
|
||||
browser.loadURI("data:text/html;charset=utf-8,<body><h2>First Tab</h2><p><input type='submit' value='Button' id='button1'/></body>");
|
||||
browser.loadURI("data:text/html;charset=utf-8,<body><h2>First Tab</h2><p><input type='submit' value='Button' id='button1'/></body>", null, null);
|
||||
}
|
||||
|
||||
function configureFirstTab() {
|
||||
@ -81,7 +81,7 @@
|
||||
// 8) Start loading second tab.
|
||||
function loadSecondTab() {
|
||||
var browser = document.getElementById("tab2browser");
|
||||
browser.loadURI("data:text/html;charset=utf-8,<body><h2>Second Tab</h2><p><input type='submit' value='Button' id='button1'/></body>");
|
||||
browser.loadURI("data:text/html;charset=utf-8,<body><h2>Second Tab</h2><p><input type='submit' value='Button' id='button1'/></body>", null, null);
|
||||
}
|
||||
|
||||
function configureSecondTab() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user