Bug 1039904 - Changing the URL in a pinned tab shouldn't open a new tab. r=gavin

This commit is contained in:
Dão Gottwald 2014-08-01 18:20:57 +02:00
parent 06d462118c
commit 3822d1b1ce
2 changed files with 5 additions and 1 deletions

View File

@ -317,6 +317,7 @@
openUILinkIn(url, "current", {
allowThirdPartyFixup: true,
disallowInheritPrincipal: !mayInheritPrincipal,
allowPinnedTabHostChange: true,
postData: postData
});
}

View File

@ -185,6 +185,7 @@ function whereToOpenLink( e, ignoreButton, ignoreAlt )
* referrerURI (nsIURI)
* relatedToCurrent (boolean)
* skipTabAnimation (boolean)
* allowPinnedTabHostChange (boolean)
*/
function openUILinkIn(url, where, aAllowThirdPartyFixup, aPostData, aReferrerURI) {
var params;
@ -220,6 +221,7 @@ function openLinkIn(url, where, params) {
var aInitiatingDoc = params.initiatingDoc;
var aIsPrivate = params.private;
var aSkipTabAnimation = params.skipTabAnimation;
var aAllowPinnedTabHostChange = !!params.allowPinnedTabHostChange;
if (where == "save") {
if (!aInitiatingDoc) {
@ -288,7 +290,8 @@ function openLinkIn(url, where, params) {
} catch (e) {}
}
if (where == "current" && w.gBrowser.selectedTab.pinned) {
if (where == "current" && w.gBrowser.selectedTab.pinned &&
!aAllowPinnedTabHostChange) {
try {
// nsIURI.host can throw for non-nsStandardURL nsIURIs.
if (!uriObj || (!uriObj.schemeIs("javascript") &&