0

I want to intercept all browser requests and then add some js into server responses before it will appears in browser.

For example "Ad muncher" is doing it. It add js that removes all ad from pages.

Please give me some advise, how I can do it?

I'm using C#.

I found 2 solutions that may be can help me:

1) www.fiddler2.com But as I understand I could only write my own plugin for it, but I can't make standalone application. And also it is a proxy-type solution..

2) www.tcpdump.org and www.winpcap.org I can't find how to modify server responses, I found some info only about sniffering the requests.

P.S: I don't want to use proxy server for this purpose.

Thanks for any help.

4

1 回答 1

0

您是否考虑过为浏览器编写插件?它不会是一个通用的解决方案,因为您必须为每个流行的浏览器开发插件 - 但它会完成工作,我认为它会比其他解决方案简单得多..

无论如何,winpcap 不允许您修改数据包。您可以检查其他选项,例如 WFP(Windows 过滤平台 - 可从 windows vista 获得)并使用它们实现这一点 - 但这可能有点矫枉过正,我认为您不能为此使用 .NET。你可以在这里阅读:http: //msdn.microsoft.com/en-us/library/bb757027.aspx

于 2012-01-21T16:02:38.630 回答