Noopener keeps a newly opened page from accessing the opener window through window.opener. Noreferrer also suppresses the Referer header for that navigation. The important question is always where the link leads and whether the person reading the page can predict it.
What You Need to Know
Modern browsers generally imply noopener with target="_blank", but writing it explicitly can make the intention clear. These keywords are not substitutes for safe URL handling.
Download hints may not work for every cross-origin resource, and browsers may choose to open files such as PDFs.
Links are the pathways through a website. The words on a link should help someone choose where to go before clicking it.
Example: See It in Action
Add this example to the appropriate part of a practice HTML page. Read each line before you open the page in your browser.
This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.
<a href="projects.html" target="_blank" rel="noopener noreferrer">
Open the project gallery in a new tab
</a>
<p>The noreferrer keyword also limits referrer information.</p>
Let’s Understand the Example
- An a element becomes a working link when it has an href. Its visible text should tell readers where they will go.
- A p groups a paragraph of related text. Start another paragraph for a new thought.
- Rel describes a relationship to the linked page or resource, including security and search hints.
- Href contains the destination of a link. A value starting with # points to an id on the same page.
- Target chooses the browsing context where a link opens. Blank usually opens a new tab.
The first example link points to projects.html. Check whether that destination exists relative to the document. A link changes where readers go; it does not perform an action such as saving a form.
What Should You See?
You should see a link named “Open the project gallery in a new tab”. Selecting it leads to projects.html when that destination exists. Try it with the mouse and the keyboard.
Imagine this link is read out of context. Would its text still explain the destination? Rename unclear links before trying to make them look nicer with CSS.
Try It Yourself
- Explain the difference between noopener and noreferrer in your own words.
- Save your changes, open or refresh the page, and compare the result with the original example.
- Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.
Common Beginner Mistakes
- Assuming noreferrer is needed for every normal internal link.
- Avoid dead links, empty href values and clickable-looking text without a real destination.
Key Takeaways
- Noopener keeps a newly opened page from accessing the opener window through window.opener.
- An a element becomes a working link when it has an href. Its visible text should tell readers where they will go.
- Download hints may not work for every cross-origin resource, and browsers may choose to open files such as PDFs.