Greasy Fork

URL Modifier for Search Engines

Modify URLs in search results of search engines

目前为 2024-01-06 提交的版本。查看 最新版本

作者
D.Rathburn
评分
0 0 0
版本
1.9
创建于
2024-01-01
更新于
2024-01-06
大小
13.3 KB
许可证
GPL-2.0-only
适用于

URL-Modifier-for-Search-Engines

Github Repo: https://github.com/domeniczz/URL-Modifier-for-Search-Engines

Introduction

Modify URLs in the search result of search engines, redirect the URL to alternatives sites or just do some other useful modification.

URL modification uses Regular Expression.

Search Engine support:

You can manually add HTML selector in the code to support other search engines.

Can't support Bing, because it only provide intermediate links.

Built-in redirection:

You can add custom redirection rules into the script yourself.

Other alternatives privacy friendly frontends, see LibRedirect.


TODO

  1. Add supports for more search engines.
  2. Refactor the code to make it easier to read and modify.

Wiki

urlModificationRules

URL modification rules in regular expression

Variable Description
matchRegex regular expression for matching original URLs
replaceWith regular expression for replacement

selectorRules

Selector rules for each search engine results

Variable Description
selector selector for DOM element
updateText flag for whether to update the text or href value of the element
childSelector selector for child DOM element under parent element
updateChildText flag for whether to update the inner text of the child element
containProtocol flag for whether to contain protocol (e.g. https://) in the domain
displayMethod required, URL display method.
method 1: breadcrumb format
method 2: full URL
method 3: full URL without protocol

searchEngines

User-defined list of search engine instance URLs

Variable Description
hosts search engine's domain
resultContainerSelectors optional, set search result container DOM, to narrow down the range of dynamic observation