Welcome Guest Search | Active Topics | Sign In | Register

DOM.Element... getBoundingClientRect how?? Options
macgyber
Posted: Tuesday, June 16, 2020 2:52:27 AM
Rank: Newbie
Groups: Member

Joined: 6/10/2020
Posts: 4
Sorry for not speaking English well.
I am using the code below.
I want to figure out the position and size of a DOM.Element object.
BoundingClientRect command is not supported.
How can I access [BoundingClientRect] in c#?
========================================

object obj = webView1.EvalScript("document.getElementsByTagName('a');");
var elsss = JSObject.CastTo<EO.WebBrowser.DOM.Collection<EO.WebBrowser.DOM.Element>>(obj);
int nnn = elsss.length;

string strxx="";
object rect;
int xxx=0;
int yyy=0;

for (int i = 0; i < nnn; i++) {
var itemx = elsss[i];
strxx =itemx.innerHTML;
rect = itemx.getBoundingClientRect();
xxx = rect.left;
yyy= rect.top;
}

eo_support
Posted: Tuesday, June 16, 2020 11:23:27 AM
Rank: Administration
Groups: Administration

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

There is no equivalent to this on the C# side. You will need to do this with JavaScript. See here for more details:

https://www.essentialobjects.com/doc/webbrowser/advanced/jsdom.aspx

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.