Skip to content

Commit

Permalink
fix(firefox,google): get correct links in Firefox for Android
Browse files Browse the repository at this point in the history
regression with v8.2.4
fix #312
  • Loading branch information
iorate committed Jan 12, 2023
1 parent 6667c11 commit 8a3d8f1
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/scripts/search-engines/google-mobile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,20 @@ const mobileSerpHandlers: Record<string, SerpHandler> = {
// Regular (iOS)
{
target: '.xpd',
level: target =>
// Web Result with Site Links
target.parentElement?.closest<HTMLElement>('.mnr-c.g') ||
(target.querySelector('.xpd') ? null : target),
level: target => {
if (target.querySelector('.kCrYT')) {
// Firefox
return null;
}
const webResultWithSiteLinks = target.parentElement?.closest<HTMLElement>('.mnr-c.g');
if (webResultWithSiteLinks) {
return webResultWithSiteLinks;
}
if (target.querySelector('.xpd')) {
return null;
}
return target;
},
url: getURLFromPing('a'),
title: '[role="heading"][aria-level="3"]',
actionTarget: '',
Expand Down

0 comments on commit 8a3d8f1

Please sign in to comment.