Hasty Treat - Target=_blank security issue? What's the deal with noopener and noreferrer?

Published: July 27, 2020, 1 p.m.

In this Hasty Treat, Scott and Wes talk about noopener and noreferrer and why you should use them with links that have blank targets.

Sentry - Sponsor

If you want to know what\u2019s happening with your errors, track them with\xa0Sentry. Sentry is open-source error tracking that helps developers monitor and fix crashes in real time. Cut your time on error resolution from five hours to five minutes. It works with any language and integrates with dozens of other services. Syntax listeners can get two months for free by visiting\xa0Sentry.io\xa0and using the coupon code \u201ctastytreat\u201d.

Show Notes

03:35 - What\u2019s the big deal?

  • If you have a link that is target="_blank" you should add rel=\u201cnoopener\u201d and rel=\u201cnoreferrer\u201d
  • Retail Me Not uses it
  • Valid use cases:
    • Same domain change the page from a popup
    • Cross domain changing page data
  • Example:\xa0https://mathiasbynens.github.io/rel-noopener/

05:39 - Why doesn\u2019t the browser just fix it?

10:48 - Does this hurt SEO?

  • It breaks analytics of the recipient site, turning a referral visit from your site into direct traffic, unless the link has UTM or similar tracking parameters. If you have a site where passing traffic offsite is part of the business model, links need an affiliate id instead.
Links Tweet us your tasty treats!