From 2cb6b36729d015f2ae40819f46fb3eb54d79720e Mon Sep 17 00:00:00 2001 From: iorate <682043+iorate@users.noreply.github.com> Date: Thu, 13 Jan 2022 12:25:57 +0900 Subject: [PATCH] fix(google): update selectors for "All" results --- src/scripts/search-engines/google-desktop.ts | 22 ++++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/scripts/search-engines/google-desktop.ts b/src/scripts/search-engines/google-desktop.ts index ef20d8876..099f0c57f 100644 --- a/src/scripts/search-engines/google-desktop.ts +++ b/src/scripts/search-engines/google-desktop.ts @@ -74,7 +74,15 @@ const desktopSerpHandlers: Record = { entryHandlers: [ // Regular, Web Result { - target: '.IsZvec, [data-content-feature]', + target: '[data-content-feature="1"]', + level: 2, + url: 'a', + title: 'h3', + actionTarget: '.eFM0qc', + actionStyle: desktopRegularActionStyle, + }, + { + target: '.IsZvec', level: target => { const inner_g = target.closest('.g'); if (!inner_g) { @@ -100,12 +108,8 @@ const desktopSerpHandlers: Record = { }, url: 'a', title: 'h3', - actionTarget: root => root.querySelector('.eFM0qc') || root, - actionStyle: actionRoot => { - actionRoot.className = css( - actionRoot.matches('.eFM0qc > *') ? desktopRegularActionStyle : { marginTop: '4px' }, - ); - }, + actionTarget: '.eFM0qc', + actionStyle: desktopRegularActionStyle, }, // Featured Snippet { @@ -243,12 +247,12 @@ const desktopSerpHandlers: Record = { { target: '.yl > div', innerTargets: - '.YwonT, .IsZvec, [data-content-feature], .kno-fb-ctx, .g, .WlydOe, .F9rcV, .RzdJxc', + '.YwonT, [data-content-feature="1"], .IsZvec, .kno-fb-ctx, .g, .WlydOe, .F9rcV, .RzdJxc', }, // AutoPagerize { target: '.autopagerize_page_info ~ div', - innerTargets: '.IsZvec, [data-content-feature], .dXiKIc', + innerTargets: '[data-content-feature="1"], .IsZvec, .dXiKIc', }, ], }),