New window notifier

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
nenamoss's picture

Do you know of a module that displays an image for links that open new windows? We're using External Links, but it uses a background image for this via CSS. To my knowledge, screen readers don't see background images. Also, the background image doesn't allow for alternate text.

According to the accessibility gurus at WebAIM, "users ought to be alerted when the link does not open in the current window or frame. The accessibility issue is that some users can get confused with the new windows." http://webaim.org/techniques/hypertext/hypertext_links#new_window

I know External Links provides an intermediate page notifying users about the new windows, but this is cumbersome. I'd just like to provide a subtle warning.

Comments

I haven't looked for a module

daniel.nitsche's picture

I haven't looked for a module that does this, but have you considered using JavaScript? According to a survey on the same site you linked to, only 1.6% of screen readers users don't have JavaScript enabled, so most users will benefit from this additional notification.

Some untested, example jQuery:

jQuery(document).ready(function() {
  jQuery('.content a[target=_blank]').append(' (link opens in a new window)');
});

This assumes that opening links in new windows is required at all, because it's not just an issue for screen reader users.

Thanks

nenamoss's picture

I'll try it! I may use an image with alt text instead of the phrase. Appreciate this.