Invalid problem of addJavascriptInterface interface in Android WebView

Before Android4.2, WebView provided a method for javascript to call Java code, which would cause a great security hole. After API 17, Android officially restricts javascript code to only call Java methods declared with the @JavascriptInterface annotation.

So you have to add a @JavascriptInterface interface to every Java method that can be called by js code.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327056784&siteId=291194637