infokiller / web-search-navigator

Web extension that adds keyboard shortcuts to Google, YouTube, Github, Amazon, and others (Chrome/Firefox/Edge/Safari)
MIT License
890 stars 74 forks source link

[Bug]: Brave search: Cycling through web results doesn't work #609

Open McFaul4 opened 5 months ago

McFaul4 commented 5 months ago

Related issues

What happened?

The arrow down and up don't work to cycle through search results when using brave search. On the images tab, everything works on Firefox, but on Chrome, only the arrows to the left and right seem to work. With j and k it's the same, and other shortcuts like focusing the search bar worked fine (on chrome at least, on Firefox the escape key didn't work either). With the News tab the arrows worked, but it always focused the image beside it separately (which was kinda annoying) and on Firefox it just scrolled through the page when pressing the up and down arrows.

Browsers

Chrome, Firefox

Other extensions

Yes

Version

0.5.2

Troubleshooting result

Anything else

On Google search, everything works flawlessly.

eggbean commented 5 months ago

Is the "i" key for Images work for you on Google Search?

McFaul4 commented 3 months ago

No it doesn't. And when i manually go to the image tab, it also only allows me to use the up and down key to navigate - a bit unconvinient.

gabefighter99 commented 2 months ago

Same issue for me. Any updates on this?

gabefighter99 commented 2 months ago

It looks to me like the nodes in BraveSearch class' included elements are wrong:

    const includedElements = [
      {
        nodes: document.querySelectorAll('.snippet.fdb > a'),
        highlightClass: 'wsn-brave-search-focused-link',
        containerSelector: (n) => n.parentElement,
      },
      ...

From my random Brave searches I couldn't find any fdb classes, only snippets. Changing ".snippet.fdb" to just ".snippet" appears to be a step in the right direction:

Screenshot 2024-09-14 at 3 16 36 PM

I can try to fix this myself if that's cool with you @infokiller