Automobile.Mobile.iOS.Automation.iOSBrowser.ExecJavascript C# (CSharp) Метод

ExecJavascript() публичный Метод

Executes some javascript in the browser
public ExecJavascript ( string js ) : string
js string /// Javascript to execute ///
Результат string
        public override string ExecJavascript(string js)
        {
            // Anything to to with UI has to go on the main thread
            nso.InvokeOnMainThread(delegate
            {
                try
                {
                    // This has a 10 second timeout
                    JsReturn = _webView.EvaluateJavascript(js);
                }
                catch
                {
                    JsReturn = null;
                }
            });

            if(JsReturn == null)
            {
                throw new TimeoutException("Timed out waiting for javascript execution");
            }

            return JsReturn;
        }