Skip to content

Commit

Permalink
fix autoChild on Google search result page
Browse files Browse the repository at this point in the history
  • Loading branch information
gdh1995 committed Sep 9, 2023
1 parent 35eb596 commit 9a2e916
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion content/link_actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,8 @@ const doPostAction = (): Rect | null => {
if (isTY(autoChild) && autoChild !== ":root" && !anyAtPos && !onlyShadow) {
click2nd = querySelector_unsafe_(autoChild, clickEl)
} else {
rect = getVisibleClientRect_(clickEl)
rect = htmlTag_(clickEl) === "a" // for www.google.com/search?q=***
&& getPreferredRectOfAnchor(clickEl as SafeElement as HTMLAnchorElement) || getVisibleClientRect_(clickEl)
const center = center_(rect, hintOptions.xy as HintsNS.StdXY | undefined)
click2nd = rect && (onlyShadow ? clickEl : elFromPoint_(center, clickEl))
click2nd = anyAtPos || click2nd && contains_s(clickEl, click2nd) ? click2nd : null
Expand Down

0 comments on commit 9a2e916

Please sign in to comment.