{"id":13537901,"url":"https://github.com/xxxily/fiddler-plus","last_synced_at":"2025-04-07T08:25:47.181Z","repository":{"id":63680300,"uuid":"98311054","full_name":"xxxily/Fiddler-plus","owner":"xxxily","description":"自定义的Fiddler规则，多环境切换、解决跨域开发、快速调试线上代码必备|高效调试分析利器","archived":false,"fork":false,"pushed_at":"2018-12-11T11:32:49.000Z","size":788,"stargazers_count":372,"open_issues_count":0,"forks_count":86,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-31T06:09:31.154Z","etag":null,"topics":["configuration","customer","developer-tools","devtools","fiddler","http-proxy","proxy","tools"],"latest_commit_sha":null,"homepage":"https://github.com/xxxily/Fiddler-plus","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xxxily.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-25T13:46:55.000Z","updated_at":"2025-03-18T16:26:25.000Z","dependencies_parsed_at":"2022-11-23T20:41:34.035Z","dependency_job_id":null,"html_url":"https://github.com/xxxily/Fiddler-plus","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxxily%2FFiddler-plus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxxily%2FFiddler-plus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxxily%2FFiddler-plus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xxxily%2FFiddler-plus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xxxily","download_url":"https://codeload.github.com/xxxily/Fiddler-plus/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247617143,"owners_count":20967543,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configuration","customer","developer-tools","devtools","fiddler","http-proxy","proxy","tools"],"created_at":"2024-08-01T09:01:04.746Z","updated_at":"2025-04-07T08:25:47.158Z","avatar_url":"https://github.com/xxxily.png","language":"JavaScript","funding_links":[],"categories":["\u003ca id=\"9eee96404f868f372a6cbc6769ccb7f8\"\u003e\u003c/a\u003e新添加的","\u003ca id=\"31d28e8b2cf6c06411cd5d178dbd3e77\"\u003e\u003c/a\u003efiddler","\u003ca id=\"9eee96404f868f372a6cbc6769ccb7f8\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"31185b925d5152c7469b963809ceb22d\"\u003e\u003c/a\u003e新添加的","\u003ca id=\"b239f12aca7aa942b45836032cbef99a\"\u003e\u003c/a\u003e转换"],"readme":"# Fiddler plus 【高效调试分析利器】\n\nFiddler是一个功能强大的HTTP抓包调试工具！但用起来却不是那么的顺手，界面繁杂、配置复杂，非常不符合高效程序猿的使用习惯...\nFiddler plus 重新定义了Fiddler的CustomRules.js，从而使Fiddler拥有了更加简单、灵活、丰富的配置方式，高逼格的显示界面，让你用起来不再羞(gan)涩(ga)。\n\n## 开发进度说明：\n  ~~最后面提到的开发计划，现已基本开发完，但最近在写说明文档，所以还需过一段时间才会发布新版本~~\n  \u003cbr\u003e\n  ~~ps:文档比代码难写多了！有木有。。。~~\n\n\n## 特点\n* 自定义皮肤，通过简单配置即可拥有跟你喜爱的编辑器一样的界面风格\n* 高亮特殊链接，一眼便可定位后台接口、快速区分前端各类静态资源\n* 快速切换运行环境，无需重启、即刻生效，环境再多也不凌乱\n* 简单配置即可彻底解决跨域开发的窘境\n* 强大的过滤功能，轻松过滤无关链接\n\n\n## 优点\u0026目标\n\t功能强大、配置简单\n\n## 界面截图\n![运行截图](https://raw.githubusercontent.com/xxxily/Fiddler-plus/master/assets/screenshot/screenshot01.png \"运行截图\")\n\n![运行截图](https://raw.githubusercontent.com/xxxily/Fiddler-plus/master/assets/screenshot/screenshot02.png \"运行截图\")\n\n## 使用方式\n\n下载当前的 CustomRules.js ，替换掉Fiddler自带的 CustomRules.js 。\n正常情况下文件的所在目录为：\n\n\t%USERPROFILE%\\Documents\\Fiddler2\\Scripts\n\n你也可以通过Fiddle菜单栏下的 Rules》Customize Rules...   即可打开编辑CustomRules\n\n## 全局配置项一览\n```javascript\n/**\n * 全局配置项\n * 可配置链接类型的颜色，代理、替换地址等，\n * 默认对象的键【key】为要匹配的规则，值【key】为匹配后的配置\n */\nvar GLOBAL_SETTING:Object = {\n    // 开启或禁止缓存\n    disableCaching:true,\n    // 过滤配置【用于过滤出哪些URL需要显示，哪些需要隐藏】\n    Filter:{\n        // 只显示URL包含以下字符的连接\n        showLinks:[\n            // \"qq.com\",\n            // \"baidu.com\",\n            // \"youdao.com\"\n        ],\n        // 不能直接吧 :443规则写在 hideLinks 过滤项上，否则大部分的无关链接都会被间接隐藏\n        // Tunnel To 影响前端审查，隐藏掉，目前无法彻底隐藏，逻辑待优化\n        hideTunnelTo:true,\n        // 隐藏URL包含以下字符串的连接 过滤\n        hideLinks:[\n            // \"baidu.com|qzone.qq.com|qq.com\",\n            \"hm.baidu.com\",\n            \"google.com|googleapis.com\"\n        ],\n        // 只显示以下文件类型【注意：是根据header的 Content-Type字段进行匹配的，所以js文件直接写js是不行的,但支持模糊匹配 】\n        // 附注：使用ContentType过滤的时候不一定准确，不带 ContentType的连接会被自动隐藏，该过滤选项的逻辑还有待优化和完善\n        showContentType:[\n            // \"image\"\n            // \"css\",\n            // \"html\",\n            // \"javascript\"\n        ],\n        // 隐藏以下文件类型\n        hideContentType:[]\n    },\n    // 替换URL【可用于多环境切换、解决跨域、快速调试线上脚本等】\n    replace:{\n        \"http://xxxily.com/\":\"http://xxxily.cc/\",\n        /*替换成本地某个对应目录下的文件*/\n        \"http://xxxily.com/m\":\"D:\\\\work\\\\\"\n    },\n    // 替换URL的高级版，可以实现多个项目区分管理，进行二级匹配等\n    replacePlus:[\n        {\n            describe:\"将【xxxily】服务器上的静态资源替换成本地服务器上的资源\",\n            source:[\n                \"http://xxxily.net\",\n                \"http://xxxily.org\",\n                \"http://xxxily.ac.cn\",\n                \"http://xxxily.cc\"\n            ],\n            /*Referer限定，方便精确控制*/\n\t        Referer:[\n\t            '\\\\w*.html'\n\t        ],\n\t        subRules:[\n\t            {\n\t              describe:\"subRules 字段跟父级字段完全一致，主要是方便对特殊情况进行单独处理\"\n\t            }\n\t        ],\n            urlContain:\"\\\\.html|\\\\.css|\\\\.js|\\\\.jpeg|\\\\.jpg|\\\\.png|\\\\.gif|\\\\.mp4|\\\\.flv|\\\\.webp\",\n            replaceWith:\"http://localhost:3000\",\n            enabled:false\n        },\n        {\n            describe:\"将【本地】请求的接口替换成某个服务器上的接口内容\",\n            source:[\n                \"http://localhost:3000/\",\n                \"http://127.0.0.1:3000/\",\n                \"http://192.168.0.101:3000/\"\n            ],\n            urlContain:\"\",\n            urlUnContain:\"\\\\.html|\\\\.css|\\\\.js|\\\\.jpeg|\\\\.jpg|\\\\.png|\\\\.gif|\\\\.ico|\\\\.mp4|\\\\.flv|\\\\.webp|/browser-sync/\",\n            // bgColor:\"#2c2c2c\",\n            color:\"#FF0000\",\n            // bold:\"true\",\n            replaceWith:\"http://xxxily.cc/\",\n            enabled:false\n        }\n    ],\n\n    // 脚本注入\n\tscriptInject:[\n\t    {\n\t      describe:\"脚本注入使用示例\",\n\t      // 要注入的脚本路径，可以是本地目录下的脚本，也可以是线上URL脚本\n\t      scriptPath:\"D:\\\\work\\\\debugTools\\\\commonInject.js\",\n\t      // 指定脚本要放置在哪个dom标签里面，默认html 可选值有：html,body,head,title\n\t      tagName:\"head\",\n\t      // 指定放置在标签的哪个位置，默认是before 可选值有 before,after\n\t      position:'after',\n\t      /*禁止注入脚本的缓存，也就是为scriptPath增加时间戳参数，默认true*/\n\t      noCaching:true,\n\t      /*条件限定*/\n\t      urlContain:[],\n\t      urlUnContain:[],\n\t      enabled: false\n\t    }\n\t],\n\n    // 注意：如果匹配的链接过多，很容易导致：数组下标超限/未将对象应用设置到对象实例等错误弹窗提示\n    callbackAcion:[\n        {\n          describe: \"回调操作示例代码\",\n          source:[\n            'http://xxxily.cc/dispather-app/dispacher\\\\?method=dispacher'\n          ],\n          // exclude:[],\n          include:[\n            '.html',\n            '.jsp'\n          ],\n          // 可选值有：OnBeforeRequest OnPeekAtResponseHeaders OnBeforeResponse OnDone OnReturningError ，想匹配多个事件可以使用|进行分隔\n          onEvent:'OnBeforeRequest',\n          callback:function(oSession,eventName){\n            var t = this;\n            console.log(eventName);\n\n            if(eventName === 'OnBeforeRequest'){\n              var Cookie  = oSession.oRequest['Cookie'];\n              if(Cookie){\n                console.log(Cookie);\n              }else {\n                console.log('没找到对应的 Cookie');\n              }\n              console.log('callbackTest:',oSession.fullUrl);\n              oSession.oRequest['Cookie'] = \"aaa\";\n            }\n\n          },\n          enabled: false\n        },\n        {\n          describe: \"篡改登录信息示例\",\n          source:[\n            'https://xxxily.cc/portal/userLoginAction!checkUser.action'\n          ],\n          onEvent:'OnBeforeRequest',\n          callback:function(oSession,eventName){\n            var webForms = oSession.GetRequestBodyAsString(),\n              strConv = coreApi.strConv,\n              webFormsObj = strConv.parse(webForms);\n\n            webFormsObj['username'] = \"testUser\";\n            webFormsObj['password'] = \"testPw\";\n\n            /*重设请求参数*/\n            oSession.utilSetRequestBody(strConv.stringify(webFormsObj));\n          },\n          enabled: false\n        },\n        {\n          describe: \"本地脚本注入示例\",\n          source:[\n            \"xxxily.net.cn\",\n            \"xxxily.com.cn\"\n          ],\n          include:[\n            '.html',\n            '.jsp',\n            'vendor.js',\n            'commonInjectForDebug'\n          ],\n          onEvent:'OnBeforeResponse',\n          callback:function(oSession,eventName){\n\n            /*给HTML页面注入调试脚本*/\n            if ( oSession.oResponse.headers.ExistsAndContains(\"Content-Type\", \"text/html\") \u0026\u0026 oSession.utilFindInResponse(\"\u003c/body\u003e\", false)\u003e-1 ){\n\n              oSession.utilDecodeResponse();\n              var oBody = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);\n\n              /*注入到head标签之前*/\n              var oRegEx = /\u003chead\u003e/i,\n                scriptList = [\n                  '\u003cscript src=\"./commonInjectForDebug.js\"\u003e\u003c/script\u003e',\n                  '\\n\u003chead\u003e'\n                ];\n              oBody = oBody.replace(oRegEx, scriptList.join(''));\n\n              oSession.utilSetResponseBody(oBody);\n            }\n\n            /*将注入的脚本地址内容替换成本地文件，实现本地脚本内容注入*/\n            if( oSession.fullUrl.indexOf('commonInjectForDebug') \u003e -1 ){\n              oSession[\"x-replywithfile\"] =\"D:\\\\work\\\\debugTools\\\\commonInject.js\";\n            }\n\n          },\n          enabled: true\n        }\n    ],\n\n    // 进行字符串查找，如果查找到将在Log面板显示查找结果\n    Search: {\n\t    inRequestHeaders: [],\n\t    inResponseHeaders: [],\n\t    inResponseBody: []\n\t},\n\n    // 界面显示配置【可以对不同链接进行颜色标识，以便快速定位相关链接】\n    UI:{\n        // 默认文本颜色\n        color:\"#c0c0c0\",//灰白色\n        // 默认背景颜色\n        bgColor:\"#2c2c2c\",//浅黑\n        bgColor_02:\"#2f2f2f\",//浅黑【用于做交替背景，可以不设置】\n        // bgColor_02:\"#4b4a4a\",\n        // 链接返回报错时的颜色\n        onError:{\n            // bgColor:\"#2c2c2c\",\n            color:\"#FF0000\" //错误红\n            // ,bold:\"true\"\n        },\n        // 不同关键词匹配对应的连接颜色，key 对应的是匹配的关键字，val对应的是匹配的颜色\n        linkColor:{\n            \"\\\\.jpg|\\\\.png|\\\\.gif\":\"#ffccff\", //粉紫色\n            \"\\\\.js\":\"#00ff00\", //原谅色\n            \"\\\\.css\":\"#ffcc66\", //米黄\n            \"\\\\.html\":\"#00d7ff\", //蓝色\n            \"\\\\.php\":\"#fff32d\", //大黄\n            \"\\\\.jsp\":\"#fd4107\" //砖红\n        },\n        // 可以为特殊状态码设置不同颜色，方便快速定位一些错误链接，例如404等\n        // 注意：这个只是根据responseCode 来匹配的，一些不存在response的链接配置是无效的，例如 502,504状态，应该是在onError里配置的\n        statusCode:{\n            \"404|408|500|502|504\":\"#FF0000\", //错误红\n            \"304\":\"#5e5e5e\" //浅灰色\n        },\n        // 高亮，对特殊的链接进行高亮设置，方便跟踪查看链接\n        highlight:{\n            \"http://localhost|192.168\":{\n                // bgColor:\"#2c2c2c\", //浅黑\n                color:\"#00ff00\", //原谅色\n                bold:\"true\",\n                describe:\"高亮测试\"\n            },\n            \"hm.baidu.com\":{\n                bgColor:\"#FF0000\", //红色\n                color:\"#fdf404\", //黄色\n                bold:\"true\",\n                describe:\"高亮测试\"\n            },\n            \"\":\"\"\n        }\n    },\n    // 一些实用工具集，先列个可能会开发的工具集，留个坑以后有时间再开发\n    Tools:{\n        // TODO API 测试工具\n        apiTest:{},\n        // TODO 重放攻击工具\n        replay:{},\n        // TODO 内容注入工具\n        contentInject:{},\n        // TODO 类似 weinre 这样的注入调试工具\n        weinre:{}\n    },\n    // 多项分隔符号【同一个配置需匹配多项规则时可以通过分隔符进行区分，这样就不用每个规则都要新开一份配置那么繁琐】\n    splitStr:\"|\",\n    // 正则匹配的修饰符：i,g,m 默认i，不区分大小写\n    regAttr:\"i\"\n};\n//全局配置项 END\n```\n\n如果需要进行要禁用某些规则，只需在菜单栏里面操作选择开启或禁用即可：Rules \u003e Fiddler-plus\n\n\n特别说明：Fiddler 的 CustomRules.js 修改配置保存后是会自动立即生效的，无需重启\n所以做服务器代理转发、切换开发环境的时候，写好配置后，只需打开或注释掉某行配置，然后保存即可实现实时切换\n\n\n\t目前主要实现了：代理、替换、过滤、UI(skin)等功能；已经可满足绝大部分开发需求了，后续将继续完善\n\n\t暂时先这样，后续等代码完善好了再补充说明文档...\n\n## 开发计划：\n\t1、完善替换功能，实现替换本地文件\n\t2、完善搜索查找功能\n\t2、实现搜索替换和注入等功能\n  ~~1、UI(skin)后续打算实现成多套可选的形式，然后可以针对域名指定不同的配色方案，这样就不用隐藏连接也可以快速区分哪些是当前需要关注的连接。~~\n  \u003cbr\u003e\n  ~~2、全局禁止缓存感觉很蠢，严重影响正常上网体验，所以缓存也计划加入到 replacePlus 配置项里，针对性禁止缓存~~\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxxxily%2Ffiddler-plus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxxxily%2Ffiddler-plus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxxxily%2Ffiddler-plus/lists"}