Last active
January 25, 2019 13:32
-
-
Save PincongBot/320313386c83e9fc02611e81a1247d92 to your computer and use it in GitHub Desktop.
在google搜索结果中一劳永逸地屏蔽所有知乎结果
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 在google搜索结果中屏蔽所有知乎结果 | |
// @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 | |
// ==/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(); | |
} | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment