Welcome Guest Search | Active Topics | Sign In | Register

Web View NewWindow Event Issue Options
Bryan
Posted: Tuesday, June 25, 2019 3:37:10 PM
Rank: Newbie
Groups: Member

Joined: 6/25/2019
Posts: 3
I am trying to pass some javascript via EvalScript on a Webview during the NewWindow event and it doesn't seem to be getting to the WebView.

Private Sub WebView1_NewWindow(sender As Object, e As NewWindowEventArgs) Handles WebView1.NewWindow
WebControl1.WebView.EvalScript("viewControl.open('a','" & e.TargetUrl & "','b');")
e.Accepted = True
End Sub

I've tried without e.Accepted and I have tried true and false. I don't want to open a NewWindow, but I want to pass the URL that is trying to be opened to WebView that raised the event.

Any advice would be appreciated.
eo_support
Posted: Tuesday, June 25, 2019 3:42:04 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,067
Hi,

If you just want to load the Url, you can simply use "WebControl1.WebView.Url = e.TargetUrl".

You won't be able to do it with EvalScript. NewWindow is usually triggered by JavaScript window.open method and allowing EvalScript inside NewWindow handler will cause JavaScript engine to be re-entered (other JavaScript code to be called before window.open returns). This is not allowed.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.