Fiddler: Is it possible to replace part of URL using OnBeforeResponse function?

爱⌒轻易说出口 提交于 2019-12-12 01:58:52

问题


if (oSession.HostnameIs("www.youtube.com") && oSession.oResponse.headers.ExistsAndContains("Content-Type","text/html")){

                oSession.utilDecodeResponse();
                oSession.utilReplaceInResponse("old string","new string");
            }

Please tell me if I'm using the above script correctly or not.

Basically, How do I to replace/hide the word dolphin from the search query ? I don't want the client browser(my Google Chrome) to see it by any means.

Example : http://www.youtube.com/results?search_query=dolphin&page=3.

If this is not possible with Fiddler,then what other application do you recommend?

Thank you


回答1:


You can replace anything in the url inside OnBeforeResponse, but doing so won't do anything useful, because the URL has already been sent to the server by then, so changing it that late has no visible impact to anything outside of Fiddler.

If you want to change the URL, do so inside OnBeforeRequest. In your FiddlerScript, look for the urlreplace handler to see how that works.



来源:https://stackoverflow.com/questions/25892688/fiddler-is-it-possible-to-replace-part-of-url-using-onbeforeresponse-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!