From 091d36b1a7e2db13408a84a59e433aab34b0f64e Mon Sep 17 00:00:00 2001 From: Kevin Payravi Date: Sun, 24 Sep 2023 23:09:55 -0600 Subject: [PATCH] More robust search filtering on mobile Google --- content-search-filtering.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content-search-filtering.js b/content-search-filtering.js index ef83d61..b9cf1bd 100644 --- a/content-search-filtering.js +++ b/content-search-filtering.js @@ -267,7 +267,11 @@ function filterSearchResults(searchResults, searchEngine, storage) { document.querySelector('#topstuff').prepend(searchRemovalNotice); } else if (document.querySelector('#main')) { var el = document.querySelector('#main'); - el.insertBefore(searchRemovalNotice, el.querySelector('div [data-hveid]').parentElement); + if (el.querySelector('#main > div[data-hveid]')) { + el.insertBefore(searchRemovalNotice, el.querySelector('div[data-hveid]')); + } else { + el.insertBefore(searchRemovalNotice, el.querySelector('div div[data-hveid]').parentElement); + } }; break; case 'bing':