I have a need to run some automation tasks in a web browser control but I seem to be facing a few limitations/unknowns that I'm not 100% sure how to resolve. The application I'm running is not for public release, so I can enforce a prerequisite that IE8 is installed.
GeckoFX (http://geckofx.org) would be great except it does not offer me an acceptable way to manipulate the DOM as I would using the WebBrowser's InvokeMember method on HtmlElement objects.
WebKit.net would be even better but it's too early in its development to offer the functionality I need to do this either.
This leaves me with the WebBrowser control. The problem with WebBrowser though is that it just runs IE, which is a big fat shared environment with all processes. In other words, all instances share cookies, sessions, proxy settings, etc.
Here's what I want:
At the end of an automation session, cookies/sessions/cache objects are not retained. Rather than clearing the global Temporary Internet Files folder, is there a way for me to access the InPrivate mode exposed by IE8?
If there is a way to access InPrivate browsing, is it possible for me to run two InPrivate-mode sessions side-by-side isolated from each other?
Ideally I'd like to be able to run multiple isolated automation tasks in separate threads, each with its own private browser control, each with its own isolated session/environment that is not retained when the task completes.
Any help or input into this would be appreciated!
Here's some code that will give you access to an InPrivate IE
No, you cannot run the WebBrowser control in InPrivate mode; it's simply not a supported scenario.
Yes, you can run two instances of IE in InPrivate mode and isolate them from each other.
Use the command line: iexplore.exe -private -nomerge