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.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

作者
brian6932
日安装量
2
总安装量
62
评分
0 0 0
版本
0.8.10
创建于
2024-08-10
更新于
2025-01-02
大小
2.6 KB
许可证
MPL-2.0
适用于

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