Rank: Member Groups: Member
Joined: 9/29/2019 Posts: 13
|
Hi,
Using InternetExplorer, after loading a page successfully, I IHTMLScriptElement as follow to add function...
HtmlElement eHead = IE.Document.GetElementsByTagName("head")[0]; HtmlElement eS = IE.Document.CreateElement("script"); IHTMLScriptElement eScript = (IHTMLScriptElement)eS.DomElement;
eScript.text = "function Configure() { alertJSONArray[0].fastTrain = false; }"; eHead.AppendChild(eScript); IE.Document.InvokeScript("Configure");
How can EO Browser achieve the above?
I could EO.WebBrowser.DOM.Element eHead = WebDoc.getElementsByTagName("head")[0]; But there was no method in EO Browser to append the new function to eHead... kindly advise.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Hi, You would just use WebView.EvalScript to run JavaScript in the page. See here for more details: https://www.essentialobjects.com/doc/webbrowser/advanced/jsThere is no IHTMLScriptElement in EO.WebBrowser because this is an interface implemented by IE and EO.WebBrowser is based on Chromium, not IE. Thanks!
|