Welcome Guest Search | Active Topics | Sign In | Register

WebView evalscript onmouseup Options
Marianoir
Posted: Sunday, May 20, 2018 9:47:42 AM
Rank: Newbie
Groups: Member

Joined: 2/17/2017
Posts: 3
Hi, im working in a project where the user can click in any object in a webpage so i get that object and manipulate it. it is worlking fine in almost all webpages but in twitter login page my code is not working and i dont know why. When i insert the code "by hand" in the html it works perfectly but not in the .net program.

When the webpage is loaded, i insert this javascript code. As you can see , a "onmouseup" where i fill a variable that i will use later in the program
Code: Visual Basic.NET
this.WebView.EvalScript("var _ODI__objeto = 'aa'");
this.WebView.EvalScript("var h1 = document.getElementsByTagName('body')[0];    var att = document.createAttribute('onmouseup');    att.value = \"_ODI__objeto = event.target\";    h1.setAttributeNode(att);  ");
this.WebView.EvalScript("function _ODI__getObject () { return _ODI__objeto };");


When the user clicks in the webpage, it triggers the click .net event and i get the clicked object.

Code: Visual Basic.NET
JSObject js = (JSObject)this.WebView.EvalScript(" _ODI__getObject();");



It works fine in most webpages but not in twitter login page, i think what happens is that the onmouse event is not fired because the variable _ODI_Objeto gets the 'aa' value in the second code.

How can i debug this?

EDITED::

I downloaded the twitter html login page and uploaded to my server and it works, so perhaps there is a problema with the time loading the page?



Thanks
eo_support
Posted: Monday, May 21, 2018 9:56:31 AM
Rank: Administration
Groups: Administration

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

You can debug the page with the built-in debugger feature. For example, if you use our TabbedBrowser sample, you can click the menu icon and then click "Show Debug UI" to display the debugger. This will display the Chromium browser engine's developer tools UI and then you can debug the page to see exactly why the script is not working as expected.

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.