Bug 1246907 - Open link in a Container Tab - in the context menu, r=Gijs

This commit is contained in:
Andrea Marchesini
2016-02-12 11:16:41 +00:00
parent e702038ff3
commit 5ca96f8ad5
3 changed files with 29 additions and 2 deletions

View File

@@ -144,9 +144,11 @@ nsContextMenu.prototype = {
var shouldShow = this.onSaveableLink || isMailtoInternal || this.onPlainTextLink;
var isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window);
var showContainers = Services.prefs.getBoolPref("privacy.userContext.enabled");
this.showItem("context-openlink", shouldShow && !isWindowPrivate);
this.showItem("context-openlinkprivate", shouldShow);
this.showItem("context-openlinkintab", shouldShow);
this.showItem("context-openlinkinusercontext-menu", shouldShow && showContainers);
this.showItem("context-openlinkincurrent", this.onPlainTextLink);
this.showItem("context-sep-open", shouldShow);
},
@@ -960,7 +962,7 @@ nsContextMenu.prototype = {
},
// Open linked-to URL in a new tab.
openLinkInTab: function() {
openLinkInTab: function(event) {
urlSecurityCheck(this.linkURL, this.principal);
let referrerURI = gContextMenuContentData.documentURIObject;
@@ -981,6 +983,7 @@ nsContextMenu.prototype = {
let params = this._openLinkInParameters({
allowMixedContent: persistAllowMixedContentInChildTab,
userContextId: event.target.getAttribute('usercontextid'),
});
openLinkIn(this.linkURL, "tab", params);
},