Syntax - Tasty Web Development Treats

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

Jul 27, 2020
Discover the importance of using 'noopener' and 'noreferrer' with 'target=_blank' links to enhance security. The hosts delve into the risks of these links, particularly how malicious sites can exploit them. They discuss why browsers haven't universally adopted fixes, despite some improvements. Learn about potential SEO impacts and analytics challenges when passing traffic between sites. This engaging conversation emphasizes why understanding these technical aspects is crucial for web developers.
Ask episode
AI Snips
Chapters
Transcript
Episode notes
ADVICE

noopener and noreferrer

  • Use rel="noopener" and rel="noreferrer" with target="_blank" links.
  • This prevents the linked site from accessing the original window's data.
INSIGHT

noreferrer Impact on Analytics

  • The rel="noreferrer" attribute strips referrer headers.
  • This breaks analytics for the recipient site, making referral visits appear as direct traffic.
ANECDOTE

RetailMeNot Example

  • RetailMeNot uses target="_blank" to open coupon codes while redirecting to the retailer's site.
  • This lets them gain affiliate revenue via referrer headers.
Get the Snipd Podcast app to discover more snips from this episode
Get the app