junkfactory / chrome-simple-gestures

GNU General Public License v3.0
2 stars 3 forks source link

patch/recursively-look-for-link: drill upwards from target to find parent 'a' tags #4

Closed LarsBrand closed 5 months ago

LarsBrand commented 6 months ago

Add support to find <a> tags further up the tree

Issue description

Gesture action 'Open new tab' can be started on a link, instead of a blank new tab, the link target/href should open.
This works fine for:

This did not work for:

Expected

href of link is opened,

Actual

Blank new tab is opened

Resolution

Recursively drill upwards, looking for the first parent <a> tag. I've picked an arbitrary cut-off of '10' levels to drill up. when no parent A tag is found within 10 parents, it will instead default to null/blank new tab.

Example page:
https://jsfiddle.net/7sm5092y/1/

Closing notes

Thank you for open-sourcing this project.
I've been using another chrome-extensions that had been hijacked (and became spyware). I've found this one as a fine replacement. I appreciate the work you've done with this extension, It greatly improves my day-to-day browsing.