Google: Skip Country Sites

Re-redirect back to Google.com when you are taken to your local Google domain despite having sent request to Google.com

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name        Google: Skip Country Sites
// @namespace   yama-masa.com
// @description Re-redirect back to Google.com when you are taken to your local Google domain despite having sent request to Google.com
// @include     https://*.google.tld/*
// @exclude     https://*.google.com/*
// @noframes
// @version     1.00
// @grant       none
// ==/UserScript==
// Note: When your browser have sent request to your local Google domain such as google.de, google.com.au, etc., the link to google.com ("Use Google.com", for example) doesn't appear in the footer area. This script will do nothing in such a case.
(function() {
    "use strict";
    var xPath = "descendant::a[@class='_Gs' and contains(text(),'Google.com')]";
    var link2Com = document.evaluate(xPath, document.body, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
    if (link2Com !== null) {
        var modURL = link2Com.href.replace(/&ei=[-\w]+/, ""); // Remove malicious parameter, probably used for tracking
        var win = window.location.replace(modURL);
    }
})();