Skip to content

fix: add target blank and rel noopener to external footer links#653

Open
reach2saksham wants to merge 1 commit intoAOSSIE-Org:mainfrom
reach2saksham:fix/footer-external-links
Open

fix: add target blank and rel noopener to external footer links#653
reach2saksham wants to merge 1 commit intoAOSSIE-Org:mainfrom
reach2saksham:fix/footer-external-links

Conversation

@reach2saksham
Copy link
Contributor

@reach2saksham reach2saksham commented Mar 12, 2026

Addressed Issues:

Fixes #630

Screenshots/Recordings:

Note to reviewer: This is a behavior change (links opening in a new tab) rather than a visual UI change.

Before: Clicking social links in the footer navigated the current tab away from the AOSSIE website.
After: Clicking external social links (GitHub, Discord, LinkedIn, X, YouTube) now correctly opens them in a new browser tab.

Additional Notes:

  • Added target="_blank" and rel="noopener noreferrer" to all external social media links in the Footer.jsx component. This ensures users are not navigated away from the AOSSIE website when clicking on external platforms.
  • Note: I deliberately omitted target="_blank" from the mailto: link. This is a web accessibility best practice to prevent the browser from opening an empty tab before launching the user's default email client.

AI Usage Disclosure:

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: TODO

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

  • Bug Fixes
    • External social media links in the footer now open in a new browser tab with enhanced security attributes to protect against potential vulnerabilities.

@coderabbitai
Copy link

coderabbitai bot commented Mar 12, 2026

📝 Walkthrough

Walkthrough

External social media links in the Footer component now include target="_blank" and rel="noopener noreferrer" attributes. These security and behavior attributes are applied to GitHub, Discord, LinkedIn, X (Twitter), and YouTube anchor elements to ensure links open in new browser tabs.

Changes

Cohort / File(s) Summary
Footer Social Links Security
src/components/shared/Footer.jsx
Added target="_blank" and rel="noopener noreferrer" attributes to five external social media anchor links (GitHub, Discord, LinkedIn, X, YouTube) to enforce opening in new tabs with security protections against window.opener access.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • Zahnentferner

Poem

🐰 A rabbit hopped through links so fine,
"Let's keep them open—new tab in time!"
With noreferrer to guard the way,
Security hops through every day. 🔗

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: adding target='_blank' and rel='noopener' attributes to external footer links, which aligns with the changeset.
Linked Issues check ✅ Passed The PR fully implements issue #630 requirements: added target='_blank' and rel='noopener noreferrer' to all external social links (GitHub, Discord, LinkedIn, X, YouTube) in the Footer component.
Out of Scope Changes check ✅ Passed All changes are directly related to issue #630 objectives; only external social links in Footer.jsx were modified with target and rel attributes, with no unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/shared/Footer.jsx`:
- Around line 62-75: Update the accessible names for the icon-only Link
components in Footer.jsx that open a new browsing context (those with
target="_blank" and rel="noopener noreferrer") by appending a clear cue such as
" (opens in a new tab)" to each aria-label (e.g., the Link instances with
aria-labels "Follow on GitHub", "Join on Discord", "Follow on LinkedIn", "Follow
on X (Twitter)", and "Subscribe on YouTube") so screen readers announce the
new-tab behavior; keep the rest of the attributes (className, href,
FontAwesomeIcon usage) unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ee470efd-f0e8-4e05-abcd-003cd7a049bd

📥 Commits

Reviewing files that changed from the base of the PR and between 8c97742 and f311eb6.

📒 Files selected for processing (1)
  • src/components/shared/Footer.jsx

Comment on lines +62 to 75
<Link aria-label="Follow on GitHub" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://github.com/AOSSIE-Org' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faGithub} size='xl' />
</Link>
<Link aria-label="Join on Discord" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://discord.gg/hjUhu33uAn'>
<Link aria-label="Join on Discord" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://discord.gg/hjUhu33uAn' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faDiscord} size='xl' />
</Link>
<Link aria-label="Follow on LinkedIn" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://www.linkedin.com/company/aossie/'>
<Link aria-label="Follow on LinkedIn" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://www.linkedin.com/company/aossie/' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faLinkedin} size='xl' />
</Link>
<Link aria-label="Follow on X (Twitter)" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://x.com/aossie_org'>
<Link aria-label="Follow on X (Twitter)" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://x.com/aossie_org' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faXTwitter} size='xl' />
</Link>
<Link aria-label="Subscribe on YouTube" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://www.youtube.com/@AOSSIE-Org'>
<Link aria-label="Subscribe on YouTube" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://www.youtube.com/@AOSSIE-Org' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faYoutube} size='xl' />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Expose the new-tab behavior in the accessible name.

These icon-only links now open a new browsing context, but the aria-labels still read like normal navigation. Please append something like “(opens in a new tab)” so screen-reader users get the same behavior cue.

♿ Suggested update
-                  <Link aria-label="Follow on GitHub" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://github.com/AOSSIE-Org' target="_blank" rel="noopener noreferrer">
+                  <Link aria-label="Follow on GitHub (opens in a new tab)" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://github.com/AOSSIE-Org' target="_blank" rel="noopener noreferrer">
                     <FontAwesomeIcon icon={faGithub} size='xl' />
                   </Link>
-                  <Link aria-label="Join on Discord" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://discord.gg/hjUhu33uAn' target="_blank" rel="noopener noreferrer">
+                  <Link aria-label="Join on Discord (opens in a new tab)" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://discord.gg/hjUhu33uAn' target="_blank" rel="noopener noreferrer">
                     <FontAwesomeIcon icon={faDiscord} size='xl' />
                   </Link>
-                  <Link aria-label="Follow on LinkedIn" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://www.linkedin.com/company/aossie/' target="_blank" rel="noopener noreferrer">
+                  <Link aria-label="Follow on LinkedIn (opens in a new tab)" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://www.linkedin.com/company/aossie/' target="_blank" rel="noopener noreferrer">
                     <FontAwesomeIcon icon={faLinkedin} size='xl' />
                   </Link>
-                  <Link aria-label="Follow on X (Twitter)" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://x.com/aossie_org' target="_blank" rel="noopener noreferrer">
+                  <Link aria-label="Follow on X (Twitter) (opens in a new tab)" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://x.com/aossie_org' target="_blank" rel="noopener noreferrer">
                     <FontAwesomeIcon icon={faXTwitter} size='xl' />
                   </Link>
-                  <Link aria-label="Subscribe on YouTube" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://www.youtube.com/@AOSSIE-Org' target="_blank" rel="noopener noreferrer">
+                  <Link aria-label="Subscribe on YouTube (opens in a new tab)" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://www.youtube.com/@AOSSIE-Org' target="_blank" rel="noopener noreferrer">
                     <FontAwesomeIcon icon={faYoutube} size='xl' />
                   </Link>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Link aria-label="Follow on GitHub" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://github.com/AOSSIE-Org' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faGithub} size='xl' />
</Link>
<Link aria-label="Join on Discord" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://discord.gg/hjUhu33uAn'>
<Link aria-label="Join on Discord" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://discord.gg/hjUhu33uAn' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faDiscord} size='xl' />
</Link>
<Link aria-label="Follow on LinkedIn" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://www.linkedin.com/company/aossie/'>
<Link aria-label="Follow on LinkedIn" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://www.linkedin.com/company/aossie/' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faLinkedin} size='xl' />
</Link>
<Link aria-label="Follow on X (Twitter)" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://x.com/aossie_org'>
<Link aria-label="Follow on X (Twitter)" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://x.com/aossie_org' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faXTwitter} size='xl' />
</Link>
<Link aria-label="Subscribe on YouTube" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://www.youtube.com/@AOSSIE-Org'>
<Link aria-label="Subscribe on YouTube" className='text-zinc-500 hover:text-[#00843D] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://www.youtube.com/@AOSSIE-Org' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faYoutube} size='xl' />
<Link aria-label="Follow on GitHub (opens in a new tab)" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://github.com/AOSSIE-Org' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faGithub} size='xl' />
</Link>
<Link aria-label="Join on Discord (opens in a new tab)" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://discord.gg/hjUhu33uAn' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faDiscord} size='xl' />
</Link>
<Link aria-label="Follow on LinkedIn (opens in a new tab)" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://www.linkedin.com/company/aossie/' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faLinkedin} size='xl' />
</Link>
<Link aria-label="Follow on X (Twitter) (opens in a new tab)" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://x.com/aossie_org' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faXTwitter} size='xl' />
</Link>
<Link aria-label="Subscribe on YouTube (opens in a new tab)" className='text-zinc-500 hover:text-[`#00843D`] dark:text-zinc-400 dark:hover:text-yellow-400 transition' href='https://www.youtube.com/@AOSSIE-Org' target="_blank" rel="noopener noreferrer">
<FontAwesomeIcon icon={faYoutube} size='xl' />
</Link>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/shared/Footer.jsx` around lines 62 - 75, Update the accessible
names for the icon-only Link components in Footer.jsx that open a new browsing
context (those with target="_blank" and rel="noopener noreferrer") by appending
a clear cue such as " (opens in a new tab)" to each aria-label (e.g., the Link
instances with aria-labels "Follow on GitHub", "Join on Discord", "Follow on
LinkedIn", "Follow on X (Twitter)", and "Subscribe on YouTube") so screen
readers announce the new-tab behavior; keep the rest of the attributes
(className, href, FontAwesomeIcon usage) unchanged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add target="_blank" rel="noopener noreferrer" to all external social links in footer

1 participant