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);
 }
Exemple #2
0
    public void AddJavaScript(string javaScript)
    {
#if UNITY_IOS || UNITY_ANDROID || UNITY_EDITOR
        uniWebView.AddJavaScript(javaScript);
#endif
    }
Exemple #3
0
 static void runJS(string evalScript, UniWebView webView)
 {
     webView.AddJavaScript(evalScript);
     webView.EvaluatingJavaScript(evalScript);
 }
Exemple #4
0
 public void RunJavaScript(string fun, string method)
 {
     webView.AddJavaScript(fun);           //"function concatme(){publicWebFunction(); }"
     webView.EvaluatingJavaScript(method); //"concatme()"
 }