Greasy Fork

来自缓存

Greasy Fork is available in English.

在搜索结果中屏蔽知乎

在google搜索结果中一劳永逸地屏蔽所有知乎结果

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         在搜索结果中屏蔽知乎
// @version      0.0.1
// @description  在google搜索结果中一劳永逸地屏蔽所有知乎结果
// @license      MIT
// @author       PincongBot
// @include      /^https?://(www|cse)\.google(\.\w+)+/search\?.*$/
// @run-at       document-start
// @grant        none
// @compatible   chrome >= 49
// @compatible   firefox >= 29
// @compatible   opera >= 46
// @compatible   safari >= 10.1
// @namespace http://greasyfork.icu/users/314505
// ==/UserScript==

(function () {
    'use strict';

    var params = new URLSearchParams(location.search),
        q = params.get("q");

    if (q && q.indexOf("-site:zhihu.com") === -1) {
        params.set("q", q + " -site:zhihu.com");
        location.search = "?" + params.toString();
    }

})()