philc / vimium

The hacker's browser.
https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb
MIT License
23.45k stars 2.49k forks source link

Collecting link hints fails entirely for page with invalid HTML `area` coordinates #4342

Closed ChristianHein closed 1 year ago

ChristianHein commented 1 year ago

Describe the bug

Vimium fails to show any link hints on the following website after pressing f: https://nba.uth.tmc.edu/neuroanatomy/index.html.
I've tested this on both Firefox and Chrome.

To Reproduce

Steps to reproduce the behavior:

  1. Go to URL "https://nba.uth.tmc.edu/neuroanatomy/index.html".
  2. Press f.
  3. Notice the corner pop-up: "Collecting hints..."
  4. Even after the pop-up goes away, nothing more happens. The expected behavior is that we should now see link hints on all valid links on the page.

Developer Console Output

MWE I've created a minimal, working example based on the above webpage which exhibits the same behavior:

<!DOCTYPE html>
<html>
  <body>
    <img src="https://nba.uth.tmc.edu/neuroanatomy/Assets/images/nao_logo_narrow_MMS.gif" width="955" height="100" usemap="#Map">
    <map name="Map">
      <area shape="poly" coords="5,5" href="#">
    </map>
    <a href="https://nba.uth.tmc.edu/neuroanatomy/index.html">Home

I believe the error occurs because the page uses invalid coordinates for the area tag. The HTML standard says there must be at least 3 coordinate pairs, but this example only uses one pair. Simply adding one more coordinate pair fixes the problem and link hints are properly shown (e.g. coords="5,5,10,10").

Browser and Vimium version

philc commented 1 year ago

Hmm, tricky. Thanks for the bug report @ChristianHein. The fix for this will go out to the store tomorrow.