يعيد توجيهك من خدمات الويب المسجلة الملكية إلى البدائل الأخلاقية (الواجهة الأمامية).
< Feedback on معيد التوجيه البديل مفتوح المصدر
@snocodile thank you very much for help! Feature added :)
I refactored all code, so you can easily add other proprietary services for redirecting.
Hope this going to help you!
It really did help, thank you! I've some suggestions for the new code now also ;)
1. While browsing I came across a Yahoo News link on a website and I became aware that the redirection does not work as intended. It leads to a "not found" page on Searx. For example: [https://www.yahoo.com/gma/no-other-arrests-likely-idaho-212900519.html]
This will lead to a "not found" page on Searx.
Changing the data entry on line 96 from "yahoo.com" to "search.yahoo.com" will fix this.
2. Then I also noticed that the redirect function on line 200 includes adding the location.pathname, which breaks any non "all" (image/video/news etc.) search queries on Yahoo and Bing.
It works with Google since pathnames don't include search categories there.
But pathnames on Bing and Yahoo for non "all" searches look like this:
bing.com/%CATEGORY/search?q=
%CATEGORY.search.yahoo.com//%CATEGORY;_ylt
So all queries here will lead to %SEARX/search/%CATEGORY... ---> Not Found.
I don't use either of these search engines so I just added a quick extra function without removing the pathname and now all searches are landing on the main tab of Searx.
It might be a worthwhile addition to also redirect all more specific searches to the correct frontend category.
3. Similalry Bing also offers translations at bing.com/translator. While I don't use this either It would helpful for those that do to add a similar redirection to lingva like in the Google Redirection for your next release!
@snocodile, hmmm, thank you, never really noticed that.
I'll look into it. Today or tomorrow, new release will be done!
@snocodile, okay, just finished coding, did some upgrades for Google ⇾ SearX and currently working on Bing ⇾ SearX.
1. Not sure about yahoo, I can't really open it now, don't know the reason, but it just redirects me to image with main yahoo page. Hope you can test it.
2. Fixed Bing to SearX, now everything works correctly and redirecting only works from search page.
3. Bing Translator doesn't save translate parameters in URL, so I cannot parse it and get them :(, sorry bud.
Tomorrow I'll upload the release to Greasy Fork.
Thanks so much for the quick work!
1) Yahoo works as intended for me. It's possible to view all the content on the site like news etc. Redirects correctly to SearX once you type something into their search box.
2) That's fine about Bing Translate. Like I said I don't even use that but I'm sure some script users do :D. Maybe redirect "bing.com/translator" to Lingva for them?
I also noticed that
3) Imgur redirect only works for images for links explicitly like "i.imgur.com/$" but not for "imgur.com/$". Removing the "i." from the data entry does nothing either for some reason.
4) It would be great if you could add an exception for medium.com and towardsdatascience.com starting pages only, because these contain overviews of all the articles while the Scribe only contains a short intro on how to use the front-end and no actual content.
@snocodile No problem!
1) Not sure if I'm going to implement that, because of two reasons, first, I'm lazy, second, if redirecting will start after typing, then not all the content will be in search request, so, that are reasons :p
2) Nah, I don't think it's a good idea (I can explain it to you if you want).
3) That's expected behavior, because some of the links without "i." don't work correctly, so I just was making sure that everything will work right.
4) Okay, thanks for report, I'll upload new version after day or two.
Nice work on the last update now you can browse the main pages of medium and towardsdatascience!
One small thing is though that the redirection for me does not work initially.
It redirects links like %SOMEOTHERHOST%.medium.com/ right away to scribe, but
1) medium.com/%pathname$ and towardsdatascience.com/%pathname% URLs don't get redirected to scribe initially when I click on an article from the respective main page for example.
2) When I refresh the article page afterwards however I get correctly redirected to scribe.
Not sure if this is because of my browser config or you are able to reproduce this as well.
OOOH, I know the reason, it's because medium and towardsdatascience have dynamic pages. It fetches data from server and displays it for user, not actually opens URL, that's the reason. I can use PerformanceObserver
to watch if some requests happen, but if I'll use it, then script will work only for even more modern browsers, there is list:
Not sure if that's good idea, but I can check if PerformanceObserver
available and use it if possible. I'm not sure if I can fix that bug, but I'll try.
@snocodile Done, now redirect should work correctly.
Great work, thanks a lot! I'm suggesting to also add a redirect for YT Music: Hyperpipe