Skip to content

Commit

Permalink
Bug 1133201 - part 1 - treat null links in BrowserUtils.linkHasNoRefe…
Browse files Browse the repository at this point in the history
…rrer as specifying rel="noreferrer"; r=Gijs,mconley

It turns out that treating null links as being OK for passing along
referrer information means that we now pass referrer information for
plain text "links" that are opened via the context menu.  For referrer
information, we should take a much more conservative approach, and
declare that null links are always treated as if they had
rel="noreferrer".
  • Loading branch information
rmottola committed Aug 24, 2019
1 parent 0bf2719 commit 97031e9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion toolkit/modules/BrowserUtils.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,11 @@ this.BrowserUtils = {
* @return a boolean indicating if linkNode has a rel="noreferrer" attribute.
*/
linkHasNoReferrer: function (linkNode) {
// A null linkNode typically means that we're checking a link that wasn't
// provided via an <a> link, like a text-selected URL. Don't leak
// referrer information in this case.
if (!linkNode)
return false;
return true;

let rel = linkNode.getAttribute("rel");
if (!rel)
Expand Down

0 comments on commit 97031e9

Please sign in to comment.