🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Google Search URL Fixup Fork

Sets the links in the JavaScript-free Google Basic Variant (gbv=1) search results to their original domains, which circumvents click routing through Google's query parameters, fixes browser history mismatch, and strips tracking query parameters.

Vous devrez installer une extension telle que Tampermonkey, Greasemonkey ou Violentmonkey pour installer ce script.

You will need to install an extension such as Tampermonkey to install this script.

Vous devrez installer une extension telle que Tampermonkey ou Violentmonkey pour installer ce script.

Vous devrez installer une extension telle que Tampermonkey ou Userscripts pour installer ce script.

Vous devrez installer une extension telle que Tampermonkey pour installer ce script.

Vous devrez installer une extension de gestionnaire de script utilisateur pour installer ce script.

(J'ai déjà un gestionnaire de scripts utilisateur, laissez-moi l'installer !)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

Vous devrez installer une extension telle que Stylus pour installer ce style.

Vous devrez installer une extension telle que Stylus pour installer ce style.

Vous devrez installer une extension telle que Stylus pour installer ce style.

Vous devrez installer une extension du gestionnaire de style pour utilisateur pour installer ce style.

Vous devrez installer une extension du gestionnaire de style pour utilisateur pour installer ce style.

Vous devrez installer une extension du gestionnaire de style pour utilisateur pour installer ce style.

(J'ai déjà un gestionnaire de style utilisateur, laissez-moi l'installer!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

Google Search URL Fixup Fork

Explanation

Google Search has two forms of search pages, one that's normally served to people with JavaScript, and one that's served to people who have it off, also known as Google Basic Variant (GBV) mode, to enable GBV mode, and not disable JS browser-wide (javascript.enabled false), you can make domains rules with uBlock Origin or uMatrix.

To be able to swap between the default and GBV mode, you can paste the line below into My filters in the uBlock Origin settings. For uMatrix, more details about this in this blog article Reverse engineering some settings for Google Search.


/^https?:\/{2}w{3}\.google\.(?:a[delmstz]|b[aefgijsty]|c(?:o(?:m(?:\.(?:a[fgru]|b[dhnorz]|c[ouy]|do|e[cgt]|fj|g[hit]|hk|jm|k[hw]|l[by]|m[mtxy]|n[agip]|om|p[aeghkry]|qa|s[abglv]|t[jrw]|u[ay]|v[cn]))?|\.(?:ao|bw|c[kr]|i[dln]|jp|k[er]|ls|m[az]|nz|t[hz]|u[gkz]|v[ei]|z[amw]))|[adfghilmnvz])|d[ejkmz]|e[es]|f[imr]|g[aeglmry]|h[nrtu]|i[emqst]|j[eo]|k[giz]|l[aiktuv]|m[degklnuvw]|n[eloru]|p[lnst]|r[osuw]|s[cehikmnort]|t[dglmnot]|vu|ws)\/search\?(?:[^/]+&)?gbv=1(?:$|[&/])/$csp=script-src 'none'

This way you can see both https://www.google.com/search?gbv=1&q=foo and https://www.google.com/search?gbv=2&q=foo side by side.

Since Google wants to track outbound domain traffic, and the Basic Variant mode lacks the JavaScript necessary to do more dynamic tracking, Google instead literally URL encodes your destination domain, and sets it as a query parameter on their own domain, which then redirects you to your destination. This Web-Extension aims to solve this, and at the same time strips tracking query parameters on search results on both GBV (gbv=1), and default (gbv=2) Google modes.

Fork benefits

  1. Reroutes Google's /imgres links for inline images (doesn't work that well on gbv=2, as it re-applies the href encoding with JS).
  2. Strips off query parameter tracking for Google domains throughout the UI.
  3. Listens to body changes to work with inline pagination (e.g. the Super-preloader UserScript, and the AutoPagerize Web-Extension). You can add the following rule to either (I made this for Super-preloader, but should work with AutoPagerize as long as you set the corresponding properties)
    
    {
        "name": "Google Basic Variant",
        "url": "^https?://w{3}\.google\.(?:a[delmstz]|b[aefgijsty]|c(?:o(?:m(?:\.(?:a[fgru]|b[dhnorz]|c[ouy]|do|e[cgt]|fj|g[hit]|hk|jm|k[hw]|l[by]|m[mtxy]|n[agip]|om|p[aeghkry]|qa|s[abglv]|t[jrw]|u[ay]|v[cn]))?|\.(?:ao|bw|c[kr]|i[dln]|jp|k[er]|ls|m[az]|nz|t[hz]|u[gkz]|v[ei]|z[amw]))|[adfghilmnvz])|d[ejkmz]|e[es]|f[imr]|g[aeglmry]|h[nrtu]|i[emqst]|j[eo]|k[giz]|l[aiktuv]|m[degklnuvw]|n[eloru]|p[lnst]|r[osuw]|s[cehikmnort]|t[dglmnot]|vu|ws)/search\?(?:[^/]+&)?gbv=1(?:$|[&/])",
        "pageElement": "css;div#main",
        "exampleUrl": "https://www.google.com/search?q=foo&gbv=1",
        "nextLink": "//a[@aria-label=\"Next page\"]"
    }
    

Icon attribution