From cee24440b73f55acadb766a9210acfc4b971da83 Mon Sep 17 00:00:00 2001 From: Autumn McKee Date: Wed, 21 Feb 2024 23:42:10 +0000 Subject: [PATCH] Also filter URLs in "Quick Peek" section --- scripts/content-search-filtering.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/content-search-filtering.js b/scripts/content-search-filtering.js index 4e91558..cf9b3a1 100644 --- a/scripts/content-search-filtering.js +++ b/scripts/content-search-filtering.js @@ -742,7 +742,10 @@ function main(mutations = null, observer = null) { } else if (currentURL.hostname.includes('kagi.com')) { // Function to filter search results in Kagi function filterKagi() { - let searchResults = document.querySelectorAll('h3>a[href*=".fandom.com"], h3>a[href*=".wiki.fextralife.com"], h3>a[href*=".neoseeker.com/wiki/"]'); + let searchResults = Array.from(document.querySelectorAll('h3>a, a.__sri-url')).filter(el => + el.href?.includes('.fandom.com') || + el.href?.includes('.wiki.fextralife.com') || + el.href?.includes('.neoseeker.com/wiki/')); filterSearchResults(searchResults, 'kagi', storage); }