From d309be7410c8d69868c673404f0827167db20ebd Mon Sep 17 00:00:00 2001 From: Kevin Payravi Date: Sun, 18 Feb 2024 01:06:03 -0600 Subject: [PATCH] Also filtering image result links in Yandex --- scripts/content-search-filtering.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/content-search-filtering.js b/scripts/content-search-filtering.js index 35e708d..fe48b08 100644 --- a/scripts/content-search-filtering.js +++ b/scripts/content-search-filtering.js @@ -480,7 +480,7 @@ async function filterSearchResults(searchResults, searchEngine, storage) { searchResultContainer = searchResult.closest('div.w-gl__result'); break; case 'yandex': - searchResultContainer = searchResult.closest('.serp-item'); + searchResultContainer = searchResult.closest('.serp-item, .MMOrganicSnippet, .viewer-snippet'); break; case 'yahoo': searchResultContainer = searchResult.closest('#web > ol > li div.itm .exp, #web > ol > li div.algo, #web > ol > li, section.algo'); @@ -676,7 +676,7 @@ function main(mutations = null, observer = null) { } else if (currentURL.hostname.includes('yandex.') || currentURL.hostname.includes('ya.ru')) { // Function to filter search results in Yandex function filterYandex() { - let searchResults = Array.from(document.querySelectorAll('.serp-item a.link, .serp-item a.Link')).filter(el => + let searchResults = Array.from(document.querySelectorAll('.serp-item a.link, .serp-item a.Link, .MMOrganicSnippet a, .viewer-snippet a')).filter(el => el.href?.includes('.fandom.com') || el.href?.includes('.wiki.fextralife.com') || el.href?.includes('.neoseeker.com/wiki/'));