Skip to content

Instantly share code, notes, and snippets.

@laomo
Last active December 29, 2015 12:49
Show Gist options
  • Save laomo/7673326 to your computer and use it in GitHub Desktop.
Save laomo/7673326 to your computer and use it in GitHub Desktop.
V2EX搜索 当前的搜索基于v2ex.com,所以由于子域名比较多,搜索记录会有很多重复。修改搜索基于当前访问的子域名,保证不重复。
// ==UserScript==
// @name V2EX搜索
// @namespace http://lmbj.net
// @description 当前的搜索基于v2ex.com,所以由于子域名比较多,搜索记录会有很多重复。修改搜索基于当前访问的子域名,保证不重复。
// @include http://www.v2ex.com/*
// @version 0.2
// ==/UserScript==
dispatch = function() {
var q = document.getElementById("q");
if (q.value != "") {
window.open('http://www.google.com/search?q=site:'+window.location.host+'/t%20' + q.value, "_blank");
}
return false;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment