Recently, I meet a troublesome problem about the WebView's multiple
javascriptInterface. I will show two demo out to describe the problem.
Demo1:
this.webView.loadUrl("http://www.google.com");
this.webView.addJavascriptInterface(test1, "test1");
this.webView.addJavascriptInterface(test11, "test11");
this.webView.loadUrl("javascript:window.test1.describle('Hello1');");
this.webView.loadUrl("javascript:window.test11.describle('Hello11');");
Of course, The two interface "test1" and "test11" can work.
Demo2:
this.webView.loadUrl("http://www.google.com");
this.webView.addJavascriptInterface(test1, "test1");
this.webView.loadUrl("javascript:window.test1.describle('Hello1');");
this.webView.addJavascriptInterface(test11, "test11");
this.webView.loadUrl("javascript:window.test11.describle('Hello11');");
In the Demo2, the WebChromeClient will tell me " TypeError: Result of
expression 'window.test11' [undefined] is not an object. at undefined:1"
I don't whether it is a normal case. But it is block my project.
Looking forwards your suggestion.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en