tstkenny 0 Newbie Poster

I've been searching for a solution for 2 weeks but no luck.

I am using Vb2005. On windows.form1 I put 2 standard Webbrowser1 control2 as WB1 & WB2, then wb1.navigate(url).

The target URL is a framed remote website. I want to get one of the frame to be displayed in my WB2.document. However, the frame I want has the following javascript inside:

if document.top <> "xxxx" then window.close();

On other words, the frame will check whether it is opened in a new window or not. So you can see that, even there is no additional concern about sessions (yes this is a member only website and has session variables), there is no way to achieve my purpose.

I drilled into the Webbrowser control which comes with Vb2005. There are only a few events and none of them can provide the document object (i.e. beforenavigate, navitage, DownloadBegin, DownloadEnd, DocumentComplete(d)).

I switched to shDoCVw browser and found several new events: newWindow2, newWindow3, navigate2, navigated, etc still no document object is provided.

I tried to use ExtendedWebbrowser I found at codeproject.c0m and no luck.

What I've been researching and no luck in the past 2 weeks:

1. Is it possible to Disable the javascript upon documentComplete? -> NO
2. Is it possible to modify the document before Webbrowser rendering? -> NO
3. Is it possible to use httpWebRequest to get the HTML? -> YES but only if I can find a way to save a session data and reuse it by CookieContainer. This is not 100% what I need 'cos the target is actually a Form. It the frame data matches my criteria I will fill out the form and submit it.
4. Is it possible to use DirectCast? Yes I tried but once I set the pDisp to WB2, it is closed (by the javascript I guess).

Is this possible? Yes I am 100% sure. I saw several 3rd party Webbrowser which can "turn javascript off". Even the M$IE has this option. I just don't know the right way to go :_(

Any idea or comments is highly appreciated.

best regards
kenny