<%
  data_attributes ||= {}
  data_attributes[:module] = 'app-escape-link'
%>
<%= link_to "Leave this site", destroy_session_flow_path(ext_r: "true"), class: "app-c-escape-link govuk-link", rel: "nofollow noreferrer noopener", target: "_blank", data: data_attributes %>

<%
  data_attributes ||= {}
  data_attributes[:module] = 'app-escape-link'
%>
<%= link_to("Hide this page",
  destroy_session_flow_path(ext_r: "true"),
  class: "app-c-escape-link govuk-link",
  rel: "nofollow noreferrer noopener",
  target: "_blank",
  data: data_attributes,
  aria: {
    label: "Hide this page. Quick exit button, it opens BBC Weather in a new tab"
  }
) %>

Fix the 'Leave this site' link purpose
Fix the 'Leave this site' link purpose

The leave this site button does not properly explain what it does, so it could be more accessible for people using screen readers

We need to design the content for what this says, so that we can make sure people get the right idea of what is happening.

See page 15 of the report - https://drive.google.com/drive/folders/13sklGDeiQv95CFXFglXZ_ka-NpOK5cGL

Also look at the discussion on the component in the design system

So people with accessibility needs can use the button

Button content:

Change from:
Leave this site

To:
Hide this page

Add hidden screen reader text:
Quick exit button, it opens BBC Weather in a new tab

Change link to:
BBC Weather - https://www.bbc.co.uk/weather

Standard followed:
https://www.w3.org/WAI/WCAG21/Techniques/aria/ARIA8.html

---

When JavaScript is disabled the link will open in a new tab so the perpetrator won’t be able to press back.
When JavaScript is enabled, in addition to the above we try to prevent the perpetrator from discovering the initial tab by changing the location of the original page.

---

https://trello.com/c/FGFqviB4/180-accessibility-smart-answer-fix-the-leave-this-site-link-purpose
