From 84892bf47849f813deec6a65c4eeba3d12ec8470 Mon Sep 17 00:00:00 2001 From: Kevin Payravi Date: Sat, 27 Apr 2024 20:22:28 -0400 Subject: [PATCH] Reverse search results when re-ordering Ensuring higher results are re-ordered to the top last --- scripts/content-search-filtering.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/content-search-filtering.js b/scripts/content-search-filtering.js index fdeac67..07e89d5 100644 --- a/scripts/content-search-filtering.js +++ b/scripts/content-search-filtering.js @@ -549,6 +549,10 @@ async function reorderSearchResults(searchResults, searchEngine, storage) { let crossLanguageSetting = storage.crossLanguage || 'off'; + // Re-order search results + // This is so that higher results are re-ordered to the top last + searchResults = searchResults.reverse(); + for (const searchResult of searchResults) { try { if (searchResult.closest('.iwb-detected')) {