Menu

noopener, noreferrer, nofollow, sponsored, ugc: 6 myths about the rel attribute on your links
📰

noopener, noreferrer, nofollow, sponsored, ugc: 6 myths about the rel attribute on your links

DEV Community: html·linkbruno.com·5 days ago
#7z9innZ2
#devto2#devto#dev#links#nofollow
Reading 0:00
15s threshold

Look at the external links in most codebases and you'll find something like this:

<a href = "https://example.org" target = "_blank" rel = "noopener noreferrer nofollow" >

Enter fullscreen mode

Exit fullscreen mode

Ask why each value is there and the answers get vague. "Security." "SEO." "The linter told me to." The rel attribute has become a junk drawer where security, privacy, analytics and search hints all live together, and plenty of myths have grown around it.

Here are six of them.

Myth 1: "Every target="_blank" link needs rel="noopener" or it's a security hole"

This used to be true. A page opened with target="_blank" could access window.opener and redirect the original tab to a phishing page, a trick known as "tabnabbing".

Modern browsers changed the default: target="_blank" now implies noopener behaviour in current versions of the major browsers.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.