Greasy Fork is available in English.

Google搜索仅显示中文页面的结果【在任意位置四击鼠标左键跳转(包括四击以上)】

通过跳转页面增加`lr=lang_zh-CN|lang_zh-TW`参数实现谷歌搜索仅显示中文页面的结果(现在已去除zh-tw的结果,因zh-tw质量似乎并不是很好)

// ==UserScript==
// @name         Google搜索仅显示中文页面的结果【在任意位置四击鼠标左键跳转(包括四击以上)】
// @namespace    https://github.com/dadaewqq/fun
// @version      0.8
// @description  通过跳转页面增加`lr=lang_zh-CN|lang_zh-TW`参数实现谷歌搜索仅显示中文页面的结果(现在已去除zh-tw的结果,因zh-tw质量似乎并不是很好)
// @author       dadaewqq
// @match        https://www.google.com/search?q=*
// @icon         https://www.google.com/favicon.ico
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
  "use strict";

  // Set the time frame in which clicks are counted
const clickTimeFrame = 800; // 500 milliseconds

// Initialize click count and timer variables
let clickCount = 0;
let clickTimer = null;

// Add event listener to the body element
document.querySelector('body').addEventListener("click", function (event) {
  // If the click target is not the search input box, start counting clicks
  // event.target.closest('.gLFyf') 是聚焦到google的搜索框 现在版本的代码不需要
  if (111 != !event.target.closest('.gLFyf')) {
    // If the click timer is running, increment the click count
    if (clickTimer !== null) {
      clickCount++;
    } else {
      // Otherwise, start the click timer and reset the click count
      clickTimer = setTimeout(() => {
        if (clickCount > 3) {
          window.location = (`${location.href}&lr=lang_zh-CN`);
        }
        clickCount = 0;
        clickTimer = null;
      }, clickTimeFrame);
      clickCount++;
    }
  }
});

})();