2

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!

Boris Daka
  • 583
  • 2
  • 14
  • 31

3 Answers3

1

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.

Community
  • 1
  • 1
vdoogs
  • 573
  • 3
  • 12
  • Yes I have seen this question but it seems really hard to figure out which one of those browser wrappers will support what I need didn't find anything yet. – Boris Daka Dec 27 '12 at 00:18
1

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

radiaku
  • 212
  • 1
  • 6
  • 17
  • It looks interesting read the blog posts look nice, Looking if you can use geckofx to see requests/responses urls now any idea if it's possible? – Boris Daka Dec 30 '12 at 03:14
  • @MarkVoidale Do you meant header response? [mozilla](http://forums.mozillazine.org/viewtopic.php?p=2999353&sid=ee27674ab94ab4f5d56680f4f88d7f73) and Check [here](https://developer.mozilla.org/en-US/docs/tag/HTTP) :D – radiaku Dec 30 '12 at 05:24
  • I have checked it it seems you cannot do it with GeckoFX found a soultion and it will be Awesomium :) thanks a lot for the help – Boris Daka Dec 30 '12 at 14:14
0

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...

VladL
  • 11,959
  • 10
  • 58
  • 82
  • I dont really need the urls of the JS or the images in the source or anything like that. When those Javascript executed they create urls with information like google analyitc pixel those the urls I need :) – Boris Daka Dec 16 '12 at 23:01