public void AddScript(InputField input) { if (_webView == null) { result.text = "Please open the web view first."; return; } // Use `AddJavaScript` to add some JavaScript function to the web page. // Be caution in Android it is a async method so you need to wait at least one frame to call the new added function. _webView.AddJavaScript(input.text); }
public void AddJavaScript(string javaScript) { #if UNITY_IOS || UNITY_ANDROID || UNITY_EDITOR uniWebView.AddJavaScript(javaScript); #endif }
static void runJS(string evalScript, UniWebView webView) { webView.AddJavaScript(evalScript); webView.EvaluatingJavaScript(evalScript); }
public void RunJavaScript(string fun, string method) { webView.AddJavaScript(fun); //"function concatme(){publicWebFunction(); }" webView.EvaluatingJavaScript(method); //"concatme()" }