Dear community,
I need to obtain all link regions from document. Currently I’m doing this in 2 steps:
- Create a link list by Iterating through the “<a>” elements in DOM and collecting their rects
- Remove from the list items, that are somehow hidden (low z-index, overflow, hidden parent, etc)
Second step is very complex - we need to check many clauses in order to decide, whether links are visible or not. Moreover, links can have one or more child elements like DIV or IMG, etc, and these elements also affect the resulting links regions. Calculating regions for partially hidden links is also a non-trivial task.
I wonder if there’s more simple way to do this. Perhaps some API or another idea I’m missing?