Commit Graph

86 Commits (249741c173ef540914965c9da7ef3f60e0645196)

Author SHA1 Message Date
Kevin Payravi 2fbf9a33dc Fixes for search engine result reordering
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).
2024-11-17 02:41:59 -05:00
Kevin Payravi 290b6f47c2 Making main page title comparison case-insensitive
Some search engines will index page titles with varying capitalization
2024-08-23 03:33:40 +01:00
Kevin Payravi 13601c0f21 Adding iwb-detected as soon as container is found 2024-08-17 04:00:54 +01:00
Razboy20 a2599520e5 fix anchor checking 2024-08-17 03:56:24 +01:00
Kevin Payravi 5d67737b73 Merge branch 'reordering-adjustments' of https://github.com/Razboy20/indie-wiki-buddy into reordering-adjustments 2024-08-16 20:08:46 +01:00
Razboy20 41c446d940
fix reordering 2024-08-16 14:07:52 -05:00
Kevin Payravi f9b920b6d8 Merge branch 'reordering-adjustments' of https://github.com/Razboy20/indie-wiki-buddy into reordering-adjustments 2024-08-16 16:36:36 +01:00
Razboy20 9f220eef77
simplify google selector on android 2024-08-15 23:34:38 -05:00
Razboy20 053099c2f3
feat: adjust re-ordering logic
continues swapping until all non-indie sites are propagated to the bottom
2024-08-15 23:33:59 -05:00
Kevin Payravi 97c814bbda Re-add checks for processedCache[0]
Checking for isNonIndie and container
2024-08-16 04:03:19 +01:00
Kevin Payravi 847c233806 Adjust re-ordering logic
* 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
2024-08-16 03:36:48 +01:00
Kevin Payravi 43b27df448 Adding jsname query for Google search container
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.
2024-08-15 05:13:45 +01:00
Kevin Payravi 14c12c3872 More null handling + fix for Google top-mount querying 2024-08-15 05:03:19 +01:00
Kevin Payravi 0f05112eaf
Merge pull request #782 from KevinPayravi/filtering-adjustments
Null handling + minor adjustments in content search filtering script
2024-08-14 22:33:35 -05:00
Kevin Payravi 66fd543a99 Re-add Google #main querying
Needed for mounting to top of Firefox Android search results DOM
2024-08-15 04:30:38 +01:00
Kevin Payravi 248c0a6c00 ts-ignore node query selector 2024-08-14 14:27:52 +01:00
Razboy20 ce13818099
perf: use .isConnected to check element presence on the page 2024-08-13 23:43:27 -05:00
Kevin Payravi 7e8bc113fe Fix for mount element query 2024-08-14 02:55:17 +01:00
Kevin Payravi 267c210c7e Null handling + return in mountToTopOfSearchResults 2024-08-14 02:53:20 +01:00
Kevin Payravi beccc60186 Revert "Null handling in content-search-filtering"
This reverts commit de7d36a958.
2024-08-12 16:57:21 +02:00
Kevin Payravi de7d36a958 Null handling in content-search-filtering 2024-08-12 15:51:12 +02:00
Kevin Payravi 20b2aa4aa4 Adjust search result container query for Ecosia
.result__body was too deep into the DOM; article's parent element is a better container
2024-08-12 15:44:49 +02:00
Razboy20 36fe4fafb2
Perf: Rewrite content scripts to run at the start of document/page loading (#776) 2024-08-12 08:41:56 -05:00
Kevin Payravi 183f9a3a6d Additional fixes 2024-08-07 11:37:52 +02:00
Kevin Payravi 066305ae7a Handling null cases 2024-08-07 10:48:13 +02:00
Razboy20 94310c25f9
Add types to content scripts (#775) 2024-08-07 03:34:34 -05:00
Kevin Payravi c132fd0961 Adjust favicon display when replacing search results
Removing white background and adding drop-shadow; increasing favicon size from 12px to 16px
2024-07-27 05:57:50 -05:00
Kevin Payravi 84b78a29a2 Adjust Google re-order insertion position
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.
2024-07-26 05:56:59 -05:00
Kevin Payravi 1c6efc0860 Filter .data-g elements from Google re-ordering 2024-07-24 04:25:19 -07:00
Kevin Payravi 2221d98dc9 Moving change observer to beginning of filtering
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.
2024-07-23 17:02:19 -07:00
Kevin Payravi fb202486dc Apply parentNode to all Google search results
Need to apply to all for consistency between the three interactions (hiding / replacing / re-ordering)
2024-07-23 16:25:53 -07:00
Kevin Payravi b1a3110c70 Adjust logic for checking/applying iwb-detected
Change in logic required due to passing search result container parentNode when replacing Google search results
2024-07-23 03:13:09 -07:00
Kevin Payravi 1affa19c9c Using parent node for Google search results
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.
2024-07-21 01:40:25 -07:00
Kevin Payravi 1b0fc20eaa Rv recent Google filter adjustments; not reliable
The .MjjYud class is sometimes applied on individual results, and other times for the div surrounding all results on a page.
2024-07-20 03:17:40 -07:00
Kevin Payravi fda94b8be5 Improvements to Google selectors 2024-07-20 02:57:42 -07:00
Kevin Payravi a993538e8b Detect Google container class for search filtering
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).
2024-07-19 01:24:28 -07:00
Kevin Payravi e1096825c5 Fix for outputting search removal notice banner
Broke during the i18n migration
2024-07-19 01:23:01 -07:00
Kevin Payravi e34b1ce5d5 Google re-ordering fix for edge case
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.
2024-07-18 04:07:14 -07:00
Dianliang233 4d9243aab7
Allow i18n for the extension (#716) 2024-06-29 05:20:53 -05:00
SnorlaxMonster 029dd60a0d
Put search engine CSS in stylesheet
Instead of injecting CSS rules into the original page's stylesheet,
store the IWB styles in a CSS file and add that file to the manifest
scripts.
2024-06-11 00:27:56 -05:00
SnorlaxMonster 4f6d09d832
Share filtering code between search engines
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.
2024-06-08 13:52:50 -05:00
Kevin Payravi b681c9b523 Decoding when checking for main page match 2024-06-07 00:43:54 -04:00
Kevin Payravi dee2c5d1a8 Update Qwant CSS selector
Previous selector no longer works
2024-06-05 22:38:23 -05:00
Kevin Payravi 5995b28efa Improvements to search engine link handling
* 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
2024-06-04 00:03:07 -04:00
Kevin Payravi 67b77a234c Improvements to Google search results re-ordering
* 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
2024-05-29 22:24:58 +02:00
Kevin Payravi 713278d791 Updating reorder hiding regex
Adding "end of line" to regex, to prevent matching partial results and hiding results we don't want to hide
2024-05-19 02:15:37 +02:00
Kevin Payravi 096a870719 Additional selectors for reorder-ignore
"div[data-docid], div[data-lpage]" captures image results
2024-05-03 16:20:52 +03:00
Kevin Payravi 623eb2d149 Adjust query for non-standard search results / Fix
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.
2024-05-03 02:38:39 +03:00
Jayden 05f36d495d
re-ordering: unconditionally check for first result = indie wiki
This check should be moved outside of the searchEngineSettings if statement, because the result of it should be applied regardless of the searchEngineSettings.
2024-05-02 16:56:12 -05:00
Kevin Payravi cf838788b2 Splitting reordering into separate loop
We now have on loop that checks which results we want to re-order, and then a second loop that actually does the re-ordering.
2024-05-01 18:59:28 -05:00