Bug 1277765 - No referrer when a link is opened by middle-click or the context menu and containers are involved, r=mconley

This commit is contained in:
Andrea Marchesini
2016-06-09 17:02:50 +02:00
parent bf70e6a04b
commit 803cd32c21
14 changed files with 295 additions and 23 deletions

View File

@@ -955,8 +955,17 @@ nsContextMenu.prototype = {
referrerURI: gContextMenuContentData.documentURIObject,
referrerPolicy: gContextMenuContentData.referrerPolicy,
noReferrer: this.linkHasNoReferrer };
for (let p in extra)
for (let p in extra) {
params[p] = extra[p];
}
// If we want to change userContextId, we must be sure that we don't
// propagate the referrer.
if ("userContextId" in params &&
params.userContextId != this.principal.originAttributes.userContextId) {
params.noReferrer = true;
}
return params;
},
@@ -998,10 +1007,6 @@ nsContextMenu.prototype = {
userContextId: parseInt(event.target.getAttribute('usercontextid'))
};
if (params.userContextId != this.principal.originAttributes.userContextId) {
params.noReferrer = true;
}
openLinkIn(this.linkURL, "tab", this._openLinkInParameters(params));
},