Intercepting Javascript's windows.open command from embedded webbrowser
From: Mike (anonymous_at_discussions.microsoft.com)
Date: 04/21/04
- Next message: saripalli: "Re: Controlling keyboard input to browser control"
- Previous message: Kevin: "Re: How to disable the right click menu on a web browser control?"
- Next in thread: Igor Tandetnik: "Re: Intercepting Javascript's windows.open command from embedded webbrowser"
- Reply: Igor Tandetnik: "Re: Intercepting Javascript's windows.open command from embedded webbrowser"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 21 Apr 2004 13:36:05 -0700
Hi! I have a WinForms application with embedded browser control. I am trying to intercept javascript's window.open() command and instead open a new form that also contains the webbrowser control. I have the following code:
private void webMain_NewWindow(PRS.WebBrowser sender, AxSHDocVw.DWebBrowserEvents2_NewWindow2Event e)
{
//MessageBox.Show("webMain_NewWindow");
try
{
e.cancel = true; //cancel new ie window
PRSBaseForm someForm = new PRSBaseForm(); // form with embedded webbrowser control
someForm.Text = String.Empty; // clear the title
someForm.webMain.RegisterAsBrowser = true;
e.ppDisp = someForm.webMain;
someForm.Visible = true;
// HOW DO I GET THE URL OF THE CHILD WINDOW???
//someForm.webMain.Navigate("http://www.someurl.com";);
someForm.Text = someForm.webMain.document.title;
}
catch{}
}
Question: How do I get the url of the child window? What do I put as a parameter of the .Navigate method? Is there a better way.
Any help is greatly appreciated.
Thank you in advance,
--Mike
- Next message: saripalli: "Re: Controlling keyboard input to browser control"
- Previous message: Kevin: "Re: How to disable the right click menu on a web browser control?"
- Next in thread: Igor Tandetnik: "Re: Intercepting Javascript's windows.open command from embedded webbrowser"
- Reply: Igor Tandetnik: "Re: Intercepting Javascript's windows.open command from embedded webbrowser"
- Messages sorted by: [ date ] [ thread ]