Rank: Advanced Member Groups: Member
Joined: 3/10/2020 Posts: 59
|
Hi, We are using EO browser (21.3.18.0) in WPF application. Issue: Popup window is not getting focus Web page have multiple links. When we click on the link it will open popup window and same popup window will be reused for other links. Issues is popup window is not focused when click on links which will load the url in existing popup window. Its working fine in IE and Chrome(98.0.4758.102 ) browsers. On clicking the link its brings the existing popup window to front and loads the url. please let us know if we need to set any property in webview to handle this scenario. In IE browser control we are setting RegisterAsBrowser property. https://docs.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa752069(v=vs.85) Thanks
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
EO.WebBrowser does not automatically set focus to the new popup window because it may not be a popup window. For example, the TabbedBrowser sample application would open the link in a new tab, not in a new popup window. Exactly how to host the new WebView, either to ignore it, or put it in a new tab, or put it in a new window, or however other way you want to handle it, is determined by your code inside the WebView's NewWindow event handler. Since exactly what kind of container is used to display the new WebView is determined by your code, EO.WebBrowser does not know how to set focus to the container of the new WebView when it loads a new Url.
What you can do is to handle the new WebView's UrlChanged event and then automatically set the focus to the container window in that event handler. Note this is not the new WebView, but the container window of the new WebView. For example, if you display the new WebView in a new popup window, then the popup window is the container.
Hope this helps. Please feel free to let us know if you have any more questions.
Thanks!
|
Rank: Advanced Member Groups: Member
Joined: 3/10/2020 Posts: 59
|
Hi, Instead of UrlChanged i had used WebView.Activate event.In activate event i had set the focus to popup container. Seems working fine. Please let us know if this is an appropriate event for this use case.
Thanks
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi,
Yes, WebView.Activate is actually more appropriate for this scenario.
Thanks!
|
Rank: Advanced Member Groups: Member
Joined: 3/10/2020 Posts: 59
|
Thanks
|