提琴手:以编程方式添加单词查询字符串
请善待,我是新来的提琴手提琴手:以编程方式添加单词查询字符串
我的目的:我想使用Fiddler作为谷歌的搜索过滤器
摘要:
我厌倦了每次使用Google时手动添加“狗”。我不希望“狗”出现在我的搜索结果中。
例如:
//www.google.com/search?q=cat +-dog
//www.google.com/search?q=baseball +-dog
CODE :
dog
替换-torrent-watch-download
// ==UserScript==
// @name Tamper with Google Results
// @namespace http://superuser.com/users/145045/krowe
// @version 0.1
// @description This just modifies google results to exclude certain things.
// @match http://*.google.com
// @match https://*.google.com
// @copyright 2014+, KRowe
// ==/UserScript==
function GM_main() {
window.onload = function() {
var targ = window.location;
if(targ && targ.href && targ.href.match('https?:\/\/www.google.com/.+#q=.+') && targ.href.search("/+-torrent/+-watch/+-download")==-1) {
targ.href = targ.href +"+-torrent+-watch+-download";
}
};
}
//-- This is a standard-ish utility function:
function addJS_Node(text, s_URL, funcToRun, runOnLoad) {
var D=document, scriptNode = D.createElement('script');
if(runOnLoad) scriptNode.addEventListener("load", runOnLoad, false);
scriptNode.type = "text/javascript";
if(text) scriptNode.textContent = text;
if(s_URL) scriptNode.src = s_URL;
if(funcToRun) scriptNode.textContent = '(' + funcToRun.toString() + ')()';
var targ = D.getElementsByTagName('head')[0] || D.body || D.documentElement;
targ.appendChild(scriptNode);
}
addJS_Node (null, null, GM_main);
起初我是去与Tampermonkey userscripts,因为我不知道提琴手
并==================== ================================================== ============
现在,让我们专注于提琴手
请求前:
我想网络ddler在末尾添加文字Google查询字符串。
有人建议我用
静态函数OnBeforeRequest(oSession:会议):
这是我的问题在于 {
if (oSession.uriContains("targetString")) { var sText = "Enter a string to append to a URL"; oSession.fullUrl = oSession.fullUrl + sText; } }
响应之前
我完全喜欢HTML响应,现在我只想在搜索框中搜索或隐藏单词而不更改搜索结果。如何完成?有任何想法吗?
http://i.stack.imgur.com/4mUSt.jpg
你们可以请采取上述信息并解决问题,我
谢谢
基础上目标定义上面,我相信你可以用你自己的*达到更好的效果Google自定义搜索引擎服务。尤其是,您可以控制GCSE微调结果,并可以通过常规的Google搜索返回。
链接:
https://www.google.com/cse/all
https://developers.google.com/custom-search/docs/structured_search
但随着提琴手的方法,你可以适用于其他几个网站,如Youtube或Bing;修改JavaScript,CSS,HTML和做更多。无论如何,我遇到了一个小问题http://imgur.com/shLr0WO,它不会适用于google.co.uk,有什么帮助吗?谢谢 – nasekt 2014-09-07 10:14:15
问题杜佩在这里问:http://www.telerik.com/forums/fiddler-programmatically-add-word-to-query-string – EricLaw 2014-09-04 14:23:10