Commit Graph

106 Commits (64cd80327bb521c7d185dd10a0ffa4947946c51f)

Author SHA1 Message Date
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 5cb05368ec Support for MoinMoin wikis + adding Python Wiki 2024-08-22 00:43:41 +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
SnorlaxMonster 6a5ee79e43
Refactor Settings page (#777)
The script for the settings page included a large amount of duplicated code, so I refactored it to put that reused code in functions instead. I also refactored other code, such as massively simplifying the function that converts the user's settings to checked radio buttons.

Additionally, I refactored the "Individual wiki settings" table to actually be built using a table, instead of a structure that only appears to be a table.

I also made various other minor adjustments to the Settings page:
* Adjust the formatting of the "icon legend" box to be consistent with the other boxes on the page.
* Replaced the emoji 🍃 instead of the Tibetan character ༄ to represent BreezeWiki. The Tibetan character was rendering much smaller than the emoji in the other boxes. But regardless, it's better not to use characters non-semantically.
* Add a border around the "individual wiki settings" table, for consistency with the other boxes on the page.
2024-08-14 22:34:48 -05: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 76cbfeab06 Move banner text icon from translation file 2024-07-24 01:53:07 -07:00
Kevin Payravi 67c46920fa Move banner text icons from translation file 2024-07-24 01:41:49 -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
DrWhoFan13 f3e73da8d1
Adding support for Swedish wikis + Swedish Wikisimpsons 2024-07-19 04:49:56 -05: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
Kevin Payravi 51a82a169d Rework banner description
Re-word to enable easier translations to other languages, by placing the host name later in the message
2024-07-18 03:21:22 -07:00
SnorlaxMonster 6cb81fd193
Display all wikifarm hosts in the redirect banner (#737)
Instead of storing the destination wiki's host as a tag, move it to a dedicated "destination_host" property.
2024-07-18 04:32:58 -05:00
SnorlaxMonster 2b14da434b
Remove reliance on platform to construct URLs (#738)
Refactor code that depends on the destination wiki's platform in order
to support generic wiki platforms (e.g. Wikidot).

Redirection to the Main Page now uses the destination_content_path to
send users directly to the destination wiki's main page, rather than
using a different URL depending on the destination wiki's software.

The only remaining code that depends on the destination wiki's software
is the construction of the search path. This code now has a default case
that doesn't add any software-specific path to a constructed search URL.
This allows any wiki, regardless of the software it runs on, to be
added by putting its full search path in the "destination_search_path"
property of the redirect definition.

As a result of these changes, it is now possible to add redirects to
Wikidot wikis, by just defining the full search path in their redirect
entry's "destination_search_path".

Co-authored-by: SnorlaxMonster <snorlaxmonster@users.noreply.github.com>
2024-07-18 04:00:34 -05:00
Dianliang233 4d9243aab7
Allow i18n for the extension (#716) 2024-06-29 05:20:53 -05:00
Kevin Payravi 36b34ec55a Wrap article encoding in try-catch
We wrap in a try-catch as decoding can sometimes fail if destination article does have special characters (e.g. %) in the title.
2024-06-11 07:12:42 -04: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