sel
Most of the clients I worked for asked that external links on their website should open a new browser window or tab. Safe External Links (sel) does this for you automatically and properly. It modifies external links to make them open a new window by adding target="_blank" and rel="noreferrer" or rel="noopener" attributes to the anchor tag.
Properly?
If you simply just have a target="_blank" on outbound links, you put your site visitors at risk of tabnapping.
Tabnapping is a phishing attack that takes advantage of user trust and inattention to detail in regard to tabs, and forces the browser to navigate to an impersonated page after the page is left. Mathias Bynens created a great Github page for demonstrating this attack.
And this is why Google Chrome’s built-in Lighthouse validation warns you if it finds an external link with a _blank target without the appropriate relation:
Lighthouse audit report warning about unsafe cross-origin link destinations.
The solution
The best thing is: Safe External Links can solve these. You only have to download and enable it, change the link formatters and update the filter formats you use.
Processed Drupal components:
- Menu links
- Link fields (
sel_linkfield formatter) - Formatted texts (
filter_selfilter plugin)