Scripting Fiddler:以编程方式向查询字符串添加单词

Scripting Fiddler:以编程方式向查询字符串添加单词,scripting,fiddler,jscript.net,Scripting,Fiddler,Jscript.net,请友善点,我是新手 我的目的:我想使用Fiddler作为谷歌搜索过滤器 摘要: 我厌倦了每次使用谷歌时手动添加“狗”。我不希望“狗”出现在我的搜索结果中 例如: //www.google.com/search?q=cat+-dog //www.google.com/search?q=棒球+-dog 代码: 狗替换为-torrent watch下载 // ==UserScript== // @name Tamper with Google Results // @namespace

请友善点,我是新手

我的目的:我想使用Fiddler作为谷歌搜索过滤器

摘要

我厌倦了每次使用谷歌时手动添加“狗”。我不希望“狗”出现在我的搜索结果中

例如:

//www.google.com/search?q=cat
+-dog

//www.google.com/search?q=棒球
+-dog

代码

替换为
-torrent watch下载

// ==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用户脚本,因为我不知道Fiddler

==================================================================================

现在,让我们关注小提琴手

请求前

我希望Fiddler在Google查询字符串的末尾添加文本

有人建议我使用

静态函数OnBeforeRequest(会话:会话){

响应前

这就是我的问题所在

我完全喜欢HTML响应,现在我只想在不改变搜索结果的情况下在搜索框中刮/隐藏单词。怎么做?有什么想法吗

你们能把上面的信息给我,帮我解决这个问题吗


谢谢你

基于上述目标定义,我相信你可以通过自己的免费谷歌定制搜索引擎服务获得更好的结果。特别是,因为你可以控制GCSE的微调结果,这些结果是通过常规谷歌搜索返回的

链接:


这里有很多问题:但是用Fiddler的方法,你可以应用到其他几个网站,比如Youtube或Bing;修改javascripts、CSS、HTML等等。总之,我遇到了一个小问题,它不适用于google.co.uk,有什么帮助吗?谢谢
    if (oSession.uriContains("targetString")) {
          var sText = "Enter a string to append to a URL";
          oSession.fullUrl = oSession.fullUrl + sText;
    }
}