Skip to content

Conversation

@lenacohen
Copy link
Contributor

@lenacohen lenacohen commented Sep 19, 2025

Addresses:

Tested with the VoiceOver screenreader on MacOS

Test instructions:

  • Navigate to each of the elements that have a tooltip:
    • EFF logo
    • "trackers" link
    • Icons above the tracker list representing the slider options
    • Domains in the tracker list
    • Domain slider options
    • Breakage warning tooltip
    • "Click to return control" tooltip
    • Google sign-in warning tooltip
    • DNT icon
  • To see the breakage warning tooltip, move a slider in the yellow (cookie-block) position to the red (block) position
Screenshot 2025-09-19 at 5 00 06 PM
  • To see the "Click to return control" tooltip, move a slider to any position
Screenshot 2025-09-19 at 4 58 03 PM
  • To see the "DNT" icon, visit https://www.nytimes.com/ and scroll down the tracker list to the domain with the DNT icon
Screenshot 2025-09-19 at 5 02 37 PM Screenshot 2025-09-19 at 4 56 31 PM

@lenacohen lenacohen added the a11y Accessibility label Sep 19, 2025
"message": "Move the slider right to allow a domain",
"description": "Domain slider list header tooltip."
},
"popup_slider_label": {
Copy link
Member

@ghostwords ghostwords Sep 19, 2025

Choose a reason for hiding this comment

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

Is this redundant information? I ask because this wasn't raised as an issue when we revised/fixed a couple of screen reader bugs with the toggle labels last time.

Also, any the tracking domains tab is already in poor shape (crashes screen readers). Any additional toggle HTML will contribute to the tracker list performance problem.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the aria-label because groupings of radio buttons should have a radiogroup role, and a radiogroup must have an accessible name (see: https://www.w3.org/WAI/ARIA/apg/patterns/radio/, https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/radiogroup_role)

Currently, when tabbing through interactive elements, the screenreader just reads "Block entirely, selected, radio button, 1 of 3." It's unclear what is blocked entirely (or cookieblocked or allowed). Adding an aria-label to the radio group provides context. However, this might be redundant when a screen reader user navigates through the non-interactive content (since that will include the domain before the slider).

Let's wait for Jesse to review and I'll remove if he doesn't think it's necessary.

Copy link
Member

@ghostwords ghostwords left a comment

Choose a reason for hiding this comment

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

I like the how the tooltips appear on keyboard navigation!

We want want to have the same stuff happen in the options page. If we don't do it here, we might want to have the helper functions live in a common location so that we can do it on the options page when ready.

It doesn't look like the "Sign in with google" breakage warning is accounted for when keyboard navigating in this PR.

src/js/popup.js Outdated
* Make tooltips keyboard accessible
*/
function triggerTooltipOnFocus() {
$('.tooltip').on('focus', function() {
Copy link
Member

@ghostwords ghostwords Sep 23, 2025

Choose a reason for hiding this comment

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

The selector here is always ".tooltip" but we don't always call .tooltipster() on ".tooltip".

Also, does triggerTooltipOnFocus() get called repeatedly? Do we attach the same listener to previously processed elements over and over?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So far, I think the only elements with a tooltip that are keyboard focusable have a tooltip class. For example, I don't call this function after$('#not-yet-blocked-header').tooltipster() because the header is not interactive/tabbable (also that element has the tooltip class). In case that changes, I added an optional parameter (with default value .tooltip) for the selector.

Ah yes the same listener was being attached several times, but I've moved the function call in renderDomains and now remove the listener before adding to prevent this!

src/js/popup.js Outdated
/**
* Make tooltips keyboard accessible
*/
function triggerTooltipOnFocus() {
Copy link
Member

@ghostwords ghostwords Sep 23, 2025

Choose a reason for hiding this comment

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

We might want to refactor this into one or two separate functions. Do we always want to call this when we call .tooltipster()? If yes, we should take the selector as a parameter and do both .tooltipster() and the focus trigger fix in the helper function.

The second part of this function, the input thing, we might want to break it out into its own function, if we don't want to do this every time we call .tooltipster(). We should probably also make its selector more specific than input.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, done!

src/js/popup.js Outdated
$('.tooltip').on('focus', function() {
$(this).tooltipster('show');
});
$('.tooltip').on('blur', function() {
Copy link
Member

Choose a reason for hiding this comment

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

I was wondering why we can't instead set the trigger to "custom" and specify focus/blur as our open/close triggers but it looks that's not supported by tooltipster? Oh well, too bad.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep! It would be nice if they supported "focus" and "blur" as custom triggers, but this is the approach they explicitly recommend for making tooltips appear on focus: https://calebjacob.github.io/tooltipster/#accessibility

"description": "Domain slider list header tooltip."
},
"popup_slider_label": {
"message": "Blocking options for $DOMAIN$",
Copy link
Member

Choose a reason for hiding this comment

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

(Waiting on addtl. feedback whether we need this but,) "blocking options" seems both too specific ("blocking") and too vague ("options"). I feel stronger about "options" than "blocking" though. Not sure about better name either.

We still use "slider" in a bunch of places but maybe we shouldn't? I've been calling these controls "toggles". What do other extensions say?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about "Settings for $DOMAIN$" or "Blocking mode for $DOMAIN$"?

Other blocking extensions don't have sliders (except for UBlock's "filtering mode") and/or are not very screenreader accessible

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alternatively:

  • Toggles for __
  • Controls for __

@lenacohen
Copy link
Contributor Author

We want want to have the same stuff happen in the options page. If we don't do it here, we might want to have the helper functions live in a common location so that we can do it on the options page when ready.

It doesn't look like the "Sign in with google" breakage warning is accounted for when keyboard navigating in this PR.

I think we should wait to update the domain tooltips on the option page until #3133 is fixed (although I haven't been able to replicate on my computer). I moved the helper functions into a common location so that it's easy when the option page is ready.

Do you mean that the "Sign in with google" warning should be tabbable? I added aria-hidden so it's read as the description of the selected toggle, but not read again at the end of the DOM. I'll need to remove that if we make it tabbable. Separately, it may be unclear to keyboard and non-keyboard users that clicking on the tooltip closes it, since I don't think that's a common pattern (unlike click-outside-to-close). To make it more accessible, we may want to add an X button and make that tabbable.

@ghostwords
Copy link
Member

ghostwords commented Sep 24, 2025

Do you mean that the "Sign in with google" warning should be tabbable?

Yeah, exactly. Tabbing through the popup never focuses on the warning, so you can't dismiss it with the keyboard.

You do kind of confusingly tab through elements hidden under the warning.

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

Labels

a11y Accessibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants