re-ordering: skip non-standard search results

pull/641/head
Jayden 2024-04-14 09:45:13 +01:00 committed by GitHub
parent 34d256fafc
commit 520130e3c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -647,6 +647,10 @@ function main(mutations = null, observer = null) {
async function reorderGoogle() {
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'));
return await reorderSearchResults(searchResults, 'google', storage);
}