Question

I have an issue bugging me for the past few weeks.

What I'm trying to accomplish: I need a webbrowser control with the ability to change user agent (once at start) and referrer. But most important The ability to see the urls responses. What I mean by that for example if you navigate to a website you get back Images/Javascripts files in response I need access to those urls (Regular Webbrowser Control will not show you those & you can't access it in any way).

I was able to do that with webbrowser + fiddlercore I can see and do what ever with those urls addresses. The problem was if you run few instances of this program (or sometimes once if the program has some automation to work with the url responses) It gets stuck or doesn't work. I tried fixing it and making it work but it's kind of a hacky solution that doesn't work right. I need a simple way to access those urls just as if you used httpwebrequest but as a webbrowser. Why I need it as a webbrowser? The way I work I need the execution of all the tracking pixels and scripts and images etc.. a normal webbrowser behaivor in httpwebrequest if you want google analytics you have to create a code to re create it, you can't just navigate and all the scripts will be execute as webbrowser, or can you?

can you guys can offer me some help or guide me in what direction should I look? Thanks a lot!

Was it helpful?

Solution

Mind to Replacing with some like geckofx ( mozilla firefox ENGINE)?

Start at this:

GeckoFX

Event now you can using xulrunner 16 ( main engine of mozilla firefox 16 ).

New GeckoFX and XulRunner

Here article about useragent in xulrunner

OTHER TIPS

I think this is what you are looking for:

Replacing .NET WebBrowser control with a better browser, like Chrome?

However there are many other "browser wrapper" implementations out there, and if nothing on that answer looks good to you let me know and I will try and recommend another.

Probably not the best solution, but you can handle DocumentCompleted event of standard WebBrowser control. Every time it fires you can get access to Image tags in WebBrowser.Document.Images and get their urls and parse WebBrowser.DocumentText for .js urls using Regex or use something like Html Agility Pack on WebBrowser.Document to get all interesting elements...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top