Fixed bug where search engine result re-ordering was not taking into account whether a user has disabled search engine filtering for a particular wiki. Also, search engine result re-ordering can now detect and compare main pages (for the purpose of hiding duplicate results from non-indie wikis).
* Re-implementing previous solution where all indie results are moved above the first non-indie result, instead of swapping
* Only hiding non-indie results that match an indie result when re-ordering is enabled
* Adjust top-mount CSS query for Firefox Android
Trying this out to help resolve issue when running on Google image results. Querying for closest jscontroller and hveid can go too far up in the DOM; jsname is another option that is sometimes closer.
Since we now take the parentNode of located Google search engine result containers, we need to adjust where we insert re-ordered results. Instead of prepending to parent node, we insert before the non-indie container.
Adding the change observer after the initial filter occurs seems to be able to cause race conditions, particularly on Startpage. This commit moves the change observer addition to the beginning of the filtering function. The downside is that adding the change observer before filtering starts isn't ideal, since filtering manipulates the DOM and can trigger a re-check.
When hiding or replacing Google search results, we now use the search result container's parentNode. This avoids some UI conflicts and issues, particularly when injecting the replacement button.
For Google search result re-ordering, we still use the original search container w/o the parent node.
Adding a check for div.MjjYud when injecting redirect button into Google search results. This helps resolve UI issues with non-traditional search results (like video results).
Google will insert the user's searches into some of their meta links. If the user does a Google search for a non-indie domain (e.g. mario.fandom.com), that domain can appear in those Google meta links and cause IWB to detect them. By filtering out links that start with /search, we avoid capturing these.
Ensure all search engines use the same code to filter which search results are results for supported non-indie wikifarms. This also fixes an apparent oversight where Qwant was not redirecting Neoseeker search results.
* Handling when Google results use Google's middleman (google.com/url?q=)
* When handling middleman links, instead of replacing search result hrefs with updated links, we now add the updated link in a custom data-iwb-href attribute
* Better handling of special characters in page titles
* Instead of moving indie results to the top of Google search results, we now move indie results above the first non-indie (Fandom / Fextra / Neoseeker) result. If no non-indie result appears, re-ordering doesn't occur. This is to avoid moving less relevant results to the top, particularly for searches for generic terms.
* Improved Google filtering to account for when Google uses their own middleman link
For identifying non-standard search results, "div[jsname]" is unreliable as Google does seem to add it to some standard search results. Replacing with checks for attributes that are more specific to Q&A dropdowns + cards.
This check should be moved outside of the searchEngineSettings if statement, because the result of it should be applied regardless of the searchEngineSettings.