|
Rank: Newbie Groups: Member
Joined: 4/2/2015 Posts: 9
|
Hello support,
Where and how can I handle EO.WebBrowser event to prevent popups or redirect to another page. The website I load to EO.WebBrowser random automatic display popup and display another website. I just want to load an fixed url. Thank you.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, You would need to handle NewWindow event: http://www.essentialobjects.com/doc/webbrowser/advanced/new_window.aspxThis event is raised when the page requests a new window (popup). You can handle the event but do nothing in the event handler to deny the popup. Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 4/2/2015 Posts: 9
|
I do nothing in this event, but the wesite still tranfer to another url, the message below never show.
private void webView1_NewWindow(object sender, EO.WebBrowser.NewWindowEventArgs e) { MessageBox.Show("this website opening new window and not show"); }
otherwise, when the website change url, this event called and the message show. private void webView1_UrlChanged(object sender, EventArgs e) { MessageBox.Show("this show"); }
Thank you.
|
|
Rank: Newbie Groups: Member
Joined: 4/2/2015 Posts: 9
|
How can I not allow Url Change?
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
The NewWindow event is for popups. To prevent redirection, you can handle BeforeNavigate event and set e.Cancel to true in that event handler.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 4/2/2015 Posts: 9
|
many thanks.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
You are welcome. Please feel free to let us know if there is anything else.
Thanks!
|
|