Problem/Motivation

The DSFR Link doc recommends rel="noopener external" on links opening an external site in a new window, and the library's shared action template always sets it with target="_blank" (link, button, footer, navigation, side menu…). Our components set rel="noopener" only (link, button), replace a rel given by the site, or set nothing at all (footer, main navigation, side menu). Link and button also miss a target="_blank" passed in the attributes, as menu links pass it.

Proposed resolution

Whenever a link opens in a new window, set rel="noopener external", keeping a rel given by the site:
- link and button: when external is on, target is blank, or the attributes carry target="_blank";
- footer, main navigation and side menu: on items with target="_blank". The side menu also gets the "- new window" title.

Share keeps rel="noopener", as the upstream share template does.
The deprecated download_block is left as is.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

just_like_good_vibes created an issue. See original summary.

just_like_good_vibes’s picture

Title: Link, button: external links miss "external" in rel » Links opening in a new window miss rel="noopener external"
Issue summary: View changes

just_like_good_vibes’s picture

Assigned: just_like_good_vibes » Unassigned
Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.