summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@wolfbeast.com>2019-05-24 10:38:19 +0000
committerGitHub <noreply@github.com>2019-05-24 10:38:19 +0000
commitf0e357608a20cb9e2fa47c992a72729af9fcac55 (patch)
tree9e344dc0f82fe3a7da6726cc1a48afe9708f959b
parentf8157b8a659f11cb76a49b819a51f06a4ceb7a7e (diff)
parent10318170bca9a08b1f3716e245aba5432d60aa2a (diff)
downloaduxp-f0e357608a20cb9e2fa47c992a72729af9fcac55.tar.gz
Merge pull request #1105 from FranklinDM/pm_uri_tabbrowser-work
Clicking a link with a target should open only 1 tab
-rw-r--r--application/palemoon/base/content/browser.js4
-rw-r--r--application/palemoon/base/content/tabbrowser.xml11
2 files changed, 13 insertions, 2 deletions
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js
index cc362d23f9..16b7c00199 100644
--- a/application/palemoon/base/content/browser.js
+++ b/application/palemoon/base/content/browser.js
@@ -4481,13 +4481,15 @@ nsBrowserAccess.prototype = {
}
let loadInBackground = gPrefService.getBoolPref("browser.tabs.loadDivertedInBackground");
+ let openerWindow = (aContext & Ci.nsIBrowserDOMWindow.OPEN_NO_OPENER) ? null : aOpener;
let tab = win.gBrowser.loadOneTab(aURI ? aURI.spec : "about:blank", {
triggeringPrincipal: triggeringPrincipal,
referrerURI: referrer,
referrerPolicy: referrerPolicy,
fromExternal: isExternal,
- inBackground: loadInBackground});
+ inBackground: loadInBackground,
+ opener: openerWindow });
let browser = win.gBrowser.getBrowserForTab(tab);
if (gPrefService.getBoolPref("browser.tabs.noWindowActivationOnExternal")) {
diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml
index aa1a89200e..b5edd54b7d 100644
--- a/application/palemoon/base/content/tabbrowser.xml
+++ b/application/palemoon/base/content/tabbrowser.xml
@@ -1337,6 +1337,7 @@
var aFromExternal;
var aRelatedToCurrent;
var aOriginPrincipal;
+ var aOpener;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
@@ -1351,6 +1352,7 @@
aFromExternal = params.fromExternal;
aRelatedToCurrent = params.relatedToCurrent;
aOriginPrincipal = params.originPrincipal;
+ aOpener = params.opener;
}
var bgLoad = (aLoadInBackground != null) ? aLoadInBackground :
@@ -1366,7 +1368,8 @@
allowThirdPartyFixup: aAllowThirdPartyFixup,
fromExternal: aFromExternal,
originPrincipal: aOriginPrincipal,
- relatedToCurrent: aRelatedToCurrent});
+ relatedToCurrent: aRelatedToCurrent,
+ opener: aOpener });
if (!bgLoad)
this.selectedTab = tab;
@@ -1489,6 +1492,7 @@
var aSkipAnimation;
var aOriginPrincipal;
var aSkipBackgroundNotify;
+ var aOpener;
if (arguments.length == 2 &&
typeof arguments[1] == "object" &&
!(arguments[1] instanceof Ci.nsIURI)) {
@@ -1504,6 +1508,7 @@
aRelatedToCurrent = params.relatedToCurrent;
aSkipAnimation = params.skipAnimation;
aOriginPrincipal = params.originPrincipal;
+ aOpener = params.opener;
aSkipBackgroundNotify = params.skipBackgroundNotify;
}
@@ -1578,6 +1583,10 @@
b.setAttribute("showresizer", "true");
}
+ if (aOpener) {
+ b.QueryInterface(Ci.nsIFrameLoaderOwner).presetOpenerWindow(aOpener);
+ }
+
if (this.hasAttribute("autocompletepopup"))
b.setAttribute("autocompletepopup", this.getAttribute("autocompletepopup"));
b.setAttribute("autoscrollpopup", this._autoScrollPopup.id);