Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated_noopener_noreferrer_definitions.md #29057

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

experimentalgithub007
Copy link

I have Simplified the Definitions of noopener and noreferrer definitions with added examples.

The noopener value prevents the opened link from gaining access to the webpage from which it was opened.
noopener: The noopener attribute ensures that a link opened in a new tab or window cannot interact with or access the original page. Without it, the new page can use JavaScript to manipulate the original page, which poses a security risk.

The noreferrer value prevents the opened link from knowing which webpage or resource has a link (or 'reference') to it. The noreferrer value also includes the noopener behaviour and thus can be used by itself as well.
For example:
"Open Example"

In this code:
target="_blank": opens the link in a new tab.
rel="noopener": prevents the new tab from accessing the original page, ensuring security.

Without noopener, the new tab could use JavaScript to interact with the original page, which is unsafe.

noreferrer: The noreferrer attribute provides both privacy and security. It prevents the new page from knowing where the user came from (hiding the referrer) and also includes the behavior of noopener, preventing the new page from accessing the original page.

For example:
"Visit Example"

In this example:
target="_blank": opens the link in a new tab.
rel="noreferrer": ensures the new page cannot see the referring page’s address (privacy) and prevents it from accessing the original page (security).

By using rel="noreferrer", you automatically get the benefits of both privacy and security.

I have Simplified the Definitions of `noopener` and `noreferrer` definitions with added examples.
@github-actions github-actions bot added the Content: Foundations Involves the Foundations content label Nov 7, 2024
@rlmoser99 rlmoser99 requested review from a team, ManonLef and wise-king-sullyman and removed request for a team and ManonLef November 8, 2024 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content: Foundations Involves the Foundations content
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant