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; }
|
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.aspxThanks!
|