philc / philc/vimium

onlyHasTabIndex elements are completely ignored

Open
#3,508 13 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
27k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
Before commit caf13c2d elements that only had tabindex attribute on them were included in link hints. After that commit they are always ignored due to this if statement:

if visibleElement.secondClassCitizen
  continue

The commit in question is from PR #2251, it was related to hiding links to elements that are obscured by other elements. It feels like the dropping of all tabindex elements was not intentional.

(quote from code before the change: "we don't want to stop being able to click some elements that we could click before" - I wholeheartedly agree)

To Reproduce
Here's the codepen with a single div with tabindex for convenient testing.

Browser and Vimium version
Browser: Chromium 79.0.3945.117 (Official Build) Arch Linux (64-bit)
OS: Linux
Vimium: 1.65.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at content_scripts/link_hints.coffee around line 845 and compare the current secondClassCitizen handling with commit caf13c2d and PR #2251. Use the linked CodePen with a tabindex-only div to reproduce the issue, then verify that such elements receive link hints while the obscured-element behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
coffeescript, javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.