mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 576343 - Make sure search provider loads are in a remote browser [r=mbrubeck]
This commit is contained in:
parent
8072bd0910
commit
d05bda64df
@ -138,6 +138,10 @@ let Util = {
|
||||
return this.makeURI(url, null, this.makeURI(base)).spec;
|
||||
},
|
||||
|
||||
isLocalScheme: function isLocalScheme(aURL) {
|
||||
return (aURL.indexOf("about:") == 0 && aURL != "about:blank") || aURL.indexOf("chrome:") == 0;
|
||||
},
|
||||
|
||||
clamp: function(num, min, max) {
|
||||
return Math.max(min, Math.min(max, num));
|
||||
},
|
||||
|
@ -516,10 +516,10 @@ var BrowserUI = {
|
||||
// We need to keep about: pages opening in new "local" tabs. We also want to spawn
|
||||
// new "remote" tabs if opening web pages from a "local" about: page.
|
||||
let currentURI = getBrowser().currentURI;
|
||||
let useLocal = (uri.schemeIs("about") && uri.spec != "about:blank");
|
||||
let hasLocal = (currentURI.schemeIs("about") && currentURI.spec != "about:blank");
|
||||
let useLocal = Util.isLocalScheme(uri.spec);
|
||||
let hasLocal = Util.isLocalScheme(currentURI.spec);
|
||||
if (useLocal || hasLocal != useLocal) {
|
||||
BrowserUI.newTab(uri.spec);
|
||||
Browser.addTab(uri.spec, true);
|
||||
} else {
|
||||
let loadFlags = Ci.nsIWebNavigation.LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP;
|
||||
getBrowser().loadURIWithFlags(uri.spec, loadFlags, null, null);
|
||||
@ -568,6 +568,15 @@ var BrowserUI = {
|
||||
|
||||
let submission = button.engine.getSubmission(this._edit.value, null);
|
||||
let flags = Ci.nsIWebNavigation.LOAD_FLAGS_NONE;
|
||||
|
||||
let currentURI = getBrowser().currentURI;
|
||||
let hasLocal = Util.isLocalScheme(currentURI.spec);
|
||||
if (hasLocal) {
|
||||
// We are in a local browser, so make a new tab and stop the initial load
|
||||
let tab = Browser.addTab("about:blank", true);
|
||||
tab.browser.stop();
|
||||
}
|
||||
|
||||
getBrowser().loadURIWithFlags(submission.uri.spec, flags, null, null, submission.postData);
|
||||
},
|
||||
|
||||
|
@ -2613,7 +2613,7 @@ Tab.prototype = {
|
||||
browser.setAttribute("type", "content");
|
||||
|
||||
let useRemote = gPrefService.getBoolPref("browser.tabs.remote");
|
||||
let useLocal = aURI.indexOf("about") == 0 && aURI != "about:blank";
|
||||
let useLocal = Util.isLocalScheme(aURI);
|
||||
browser.setAttribute("remote", (!useLocal && useRemote) ? "true" : "false");
|
||||
|
||||
// Append the browser to the document, which should start the page load
|
||||
|
Loading…
Reference in New Issue
Block a user