Bug 1690030, change view image on context menu to default to open in a new tab, r=Gijs,fluent-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D107336
This commit is contained in:
Neil Deakin
2021-03-11 19:54:41 +00:00
parent a0c0fd369a
commit 4697e9c46e
6 changed files with 38 additions and 28 deletions

View File

@@ -1364,11 +1364,15 @@ class nsContextMenu {
// Change current window to the URL of the image, video, or audio.
viewMedia(e) {
let where = whereToOpenLink(e, false, false);
if (where == "current") {
where = "tab";
}
let referrerInfo = this.contentData.referrerInfo;
let systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
if (this.onCanvas) {
this._canvasToBlobURL(this.targetIdentifier).then(function(blobURL) {
openUILink(blobURL, e, {
openUILinkIn(blobURL, where, {
referrerInfo,
triggeringPrincipal: systemPrincipal,
});
@@ -1379,7 +1383,9 @@ class nsContextMenu {
this.principal,
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT
);
openUILink(this.mediaURL, e, {
// Default to opening in a new tab.
openUILinkIn(this.mediaURL, where, {
referrerInfo,
forceAllowDataURI: true,
triggeringPrincipal: this.principal,