For search re-ordering, avoid capturing Q&A

Check for JS-powered sections via div[jsname]

Co-Authored-By: Jayden <7265189+jayktaylor@users.noreply.github.com>
pull/662/head
Kevin Payravi 2024-05-01 14:50:52 -05:00
parent f55cd3b795
commit 1f5f969750
1 changed files with 1 additions and 1 deletions

View File

@ -660,7 +660,7 @@ function startFiltering(searchEngine, storage, mutations = null, observer = null
let searchResults = document.querySelectorAll("div[data-hveid] a:first-of-type:not([role='button']):not([target='_self'])");
// Remove any matches that are not "standard" search results - this could've been done with :has() but limited browser support right now
searchResults = Array.from(searchResults).filter((e) => !e.closest('g-section-with-header'));
searchResults = Array.from(searchResults).filter((e) => !e.closest('g-section-with-header, div[jsname]'));
return await reorderSearchResults(searchResults, 'google', storage);
}