Nederlands | Svenska | Suomi | Dansk | 한국어 | Italiano | Českina | Ελληνικά | עִבְרִית
Polski | Türkçe | Română | Magyar | Norsk | Українська | Indonesia | Việt | हिंदी | فارسی
Catalogue:
A Tampermonkey script, install from Greasy Fork: URL Modifier for Search Engines.
If you do not have Tampermonkey installed in your browser, you can install it from Chrome Web Store or Firefox Web Store.
- GitHub Repository: https://github.com/domeniczz/URL-Modifier-for-Search-Engines
- Codeberg Repository: https://codeberg.org/Domenic/URL-Modifier-for-Search-Engine-Results
Please give me a Star on GitHub or Codeberg if you found my script useful! Thank you! 😘
This Tampermonkey script enhances your search engine usage by modifying URLs in the search result of search engines, redirecting to alternative sites, allowing for a more customized and efficient browsing experience. You can also add you custom URL modification rule to the script and are welcomed to commit your rules to this script to make it much more useful.
URL modification uses Regular Expression.
- Bing
- Yahoo
- Yahoo Japan ヤフー
- Baidu
- Yandex
- SearXNG
- StartPage
- Brave
- DuckDuckGo
- Ghostery
- Presearch
- Metager
- 4get
- LibreY
- Stract
- Whoogle
- eTools
- Mojeek
- Yep
- Torry
- Qwant
- Ecosia
- Oscobo
- GOOD
- All the internet
- Searchalot
- AOL
- OneSearch
- Info
- OceanHero
- Swisscows
- Lilo
- Entireweb
- TadaDoo
- GMX
- YouCare
- Lycos
- AlohaFind
- Murena Spot
- Qmamu
- Carrot2
- Nona
- SAPO
- Exalead
- Biglobe ビッグローブ
- Goo 検索
- Walla! וואלה! חיפוש
- Cốc Cốc
- Seznam
- StartSiden SØK
- Marginalia
- Mwmbl
- Naver 네이버
- Gibiru
- Lukol
- Draze
- Yelliot
- eFind
- Fireball
- Freespoke
- GoGoPrivate
- Result Hunter
- GiveWater
- Excite
- WebCrawler
- MetaCrawler
- Dogpile
- Infospace
- RefSeek
- ZapMeta
- iZito
- Ask
- Pronto
- Anoox
You can manually add DOM selector in the code to support other search engines.
For search engine Bing, if you get redirection link "https://www.bing.com/ck/a..." in search results, disabling "Open links in a new tab or window" in the Bing settings can get rid of it.
For search engines like Yahoo, Lycos, AlohaFind, the script support getting rid of redirection links and extract the real URL. For example, the Yahoo redirection link is "https://r.search.yahoo.com/...". If you do not use these search engines, you can choose to use URL modification rules without redirection link compatibility. BTW, you can see all built-in RegEx URL modification rules here.
For Baidu, the script can get rid of redirection link of text search results, but won't work for image and video results. Because the principle is extract the original URL link explicitly shown in the DOM elements of search results. Baidu does not provide original link explicitly for some results, thus, the script won't work for that kinds of results. FYI, tampermonkey script AC-baidu_RedirectRemove can get rid of all uncessary redirection for Baidu.
Just a side note, Kagi is a search engine with built-in URL redirection functionality, worth trying out. I am a user of Kagi, and I am very satisfied with this product, so I'm giving them a shout-out here.
Find more search engines:
- Wikipedia -> Wikiwand
- Reddit -> Libreddit (e.g. safereddit.com)
- Quora -> Quetre (e.g. quetre.iket.me)
- X (Twitter) -> Nitter (Has been discontinued)
- Stack Overflow -> Anonymous Overflow (e.g. code.whatever.social)
- Medium -> Freedium
- Youtube -> Invidious (e.g. yewtu.be)
- Youtube Music -> Hyperpipe (e.g. hyperpipe.surge.sh)
- Twitch -> SafeTwitch (e.g. ttv.vern.cc)
- IMDB -> LibreMDB (e.g. ld.vern.cc)
- Goodreads -> BiblioReads (e.g. bl.vern.cc)
- Urban Dictionary -> Rural Dictionary (e.g. rd.vern.cc)
- GitHub.ink -> GitHub
- Hacker news -> hckrnws (e.g. hckrnws.com)
- Fandom -> BreezeWiki (e.g. antifandom.com)
- Reuters -> Neuters (e.g. nu.vern.cc)
- Financial Times -> Webpage Archive
- Bloomberg -> Webpage Archive
- NPR -> NPR Text
- Snopes -> Suds (e.g. sd.vern.cc)
- Instructables -> Destructables (e.g. ds.vern.cc)
- Genius -> Dumb (e.g. dm.vern.cc)
- Bandcamp -> Tent (e.g. tn.vern.cc)
- Imgur -> Rimgo (e.g. rimgo.totaldarkness.net)
- Pixiv -> PixivFE (e.g. pixivfe.exozy.me)
- Know Your Meme -> MeMe (e.g. mm.vern.cc)
- Tenor -> Soprano (e.g. sp.vern.cc)
- iFunny -> UNfunny (e.g. uf.vern.cc)
- ArXiv PDF (arxiv.org/pdf/*.pdf) -> ArXiv Abstract (arxiv.org/abs/*)
- ...
You can add custom redirection rules into the script yourself.
Other alternatives privacy friendly frontends, see:
Service providers:
- vern.cc
- lunar.icu
- projectsegfau.lt
- privacydev.net
- frontendfriendly.xyz
- pussthecat.org
- tiekoetter.com
- ...
FWIW, you could use Farside that automatically redirect to working instances of privacy-oriented alternative frontends instead of writing regular expression rules on our own.
However, this method does not support finer-grained control over matched URLs and it is really slow since a redirection by farside is needed. If you want to use this anyway, you can uncomment the corresponding part in urlModificationRules
.
-
Include pattern example:
^(?:https?:\/\/)(?:[\w-]+\.|)((?:imdb|imgur|instagram|medium|odysee|quora|reddit|tiktok|twitter|wikipedia|youtube)\.(?:[a-z]+).*)
-
Redirect to:
https://farside.link/$1
-
Add to script:
const urlModificationRules = [ { matchRegex: new RegExp(/^(?:https?:\/\/)(?:[\w-]+\.|)((?:imdb|imgur|instagram|medium|odysee|quora|reddit|tiktok|twitter|wikipedia|youtube)\.(?:[a-z]+).*)/), replaceWith: 'https://farside.link/$1' }, // ... ];
-
Example URL:
https://www.youtube.com/watch?v=abc123
-
Result URL:
https://farside.link/youtube.com/watch?v=abc123
FYI, wiki for setting up farside in Redirector: https://github.com/benbusby/farside/wiki/Browser-Extension
- Add supports for more search engines.
- Refactor the code to make it easier to read and modify.
URL modification rules in regular expression
Variable | Description |
---|---|
matchRegex | regular expression for matching original URLs |
replaceWith | regular expression for replacement |
Selector rules for the DOM elements needs updating for search engine results
Variable | Description |
---|---|
selector | selector for DOM element |
parentSelector | selector for parent of link element and text element |
linkNodeSelector | selector for link element under the the element specified by parentSelector |
textNodeSelector | selector for text element under the the element specified by parentSelector |
updateChildText | flag for whether to update the inner text of the child element specified by childSelector |
childSelector | selector for child DOM element under the element specified by selector or textNodeSelector |
updateTextWithoutOverwrite | flag for update the textnode without overwriting other nodes under the DOM element |
updateTextByOverwritecontainProtocol | flag for update the content by overwriting everything under the DOM elementflag for whether to contain protocol (e.g. https://) in the domain |
useTopLevelDomain | flag for whether to use the top-level domain when displaying URLs |
urlDisplayMethod | required, URL display method method 1: breadcrumb format method 2: full URL method 3: full URL without protocol |
multiElementsForUrlDisplay | flag for whether the displayed URL is separated into multiple DOM elements method 1: URL parts are scattered into parallel elements method 2: URL parts are scattered into non-parallel elements method 3: same as method 2, but update elements without clearing their original contents |
User-defined list of search engine domains
Variable | Description |
---|---|
hosts | search engine's domain |
resultContainerSelectors | optional, set search result container DOM, to narrow down the range of dynamic observation |
attribute | specify additional URL link attribute in <a> other than 'href' (e.g. 'data-target') no need to specify this if all the link attributes are 'href' |