No GoogleHK

Make Google.com.HK redirect to Google.com.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         No GoogleHK
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Make Google.com.HK redirect to Google.com.
// @author       Redirect
// @match        https://www.google.com.hk/
// @icon         https://www.google.com/images/branding/googleg/1x/googleg_standard_color_128dp.png
// @connect      www.google.com.hk
// @include      *://www.google.com.hk/*
// @grant        GM_getValue
// @grant        GM.getValue
// @grant        GM_setValue
// @grant        GM.setValue
// @grant        GM_addStyle
// @grant        GM_getResourceURL
// @grant        GM_listValues
// @grant        GM_getResourceUrl
// @grant        GM.getResourceUrl
// @grant        GM_xmlhttpRequest
// @grant        GM_getResourceText
// @grant        GM_registerMenuCommand
// @grant        unsafeWindow
// ==/UserScript==

(function() {
    'use strict';
    var test = window.location.href;
    if (test == 'https://www.google.com.hk/'|| test == 'http://www.google.com.hk/'|| test == 'https://www.google.com.hk'|| test == 'http://www.google.com.hk'|| test == 'https:\\\\www.google.com.hk\\'|| test == 'http:\\\\www.google.com.hk\\'|| test == 'https:\\\\www.google.com.hk'|| test == 'http:\\\\www.google.com.hk'){
        window.location.href=('https://www.google.com/ncr');
    }
    else{
        if (test.charAt(4)=='s'){
            test=test.substring(26);
            window.location.href=('https://www.google.com/'+ test);
        }
        else{
            test=test.substring(25);
            window.location.href=('https://www.google.com/'+ test);
        }
    }
})();