diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc index 0995fbabc76b..84540b459fc6 100644 --- a/browser/base/content/browser-menubar.inc +++ b/browser/base/content/browser-menubar.inc @@ -610,7 +610,7 @@ label="&reportDeceptiveSiteMenu.title;" accesskey="&reportDeceptiveSiteMenu.accesskey;" observes="reportPhishingBroadcaster" - oncommand="openUILink(gSafeBrowsing.getReportURL('Phish'), event);" + oncommand="openUILink(gSafeBrowsing.getReportURL('Phish'), event, {triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({})});" onclick="checkForMiddleClick(this, event);" hidden="true"/> openUILink(this.value, ev)); + urlLabel.addEventListener("click", ev => openUILink(this.value, ev, {triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({})})); urlContainer.appendChild(urlLabel); const subscribeButton = document.createElement("button"); diff --git a/browser/base/content/test/general/browser_utilityOverlay.js b/browser/base/content/test/general/browser_utilityOverlay.js index 9397d818fb60..390d3abdc5ed 100644 --- a/browser/base/content/test/general/browser_utilityOverlay.js +++ b/browser/base/content/test/general/browser_utilityOverlay.js @@ -107,5 +107,5 @@ function test_openUILink() { runNextTest(); }); - openUILink("http://example.org/"); // defaults to "current" + openUILink("http://example.org/", null, {triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({})}); // defaults to "current" } diff --git a/browser/base/content/utilityOverlay.js b/browser/base/content/utilityOverlay.js index 7091feccc5a1..cb1a86a27c54 100644 --- a/browser/base/content/utilityOverlay.js +++ b/browser/base/content/utilityOverlay.js @@ -120,12 +120,7 @@ function openUILink(url, event, aIgnoreButton, aIgnoreAlt, aAllowThirdPartyFixup } if (!params.triggeringPrincipal) { - let dt = event ? event.dataTransfer : null; - if (!!dt && dt.mozSourceNode) { - params.triggeringPrincipal = dt.mozSourceNode.nodePrincipal; - } else { - params.triggeringPrincipal = Services.scriptSecurityManager.createNullPrincipal({}); - } + throw new Error("Required argument triggeringPrincipal missing within openUILink"); } let where = whereToOpenLink(event, aIgnoreButton, aIgnoreAlt);