import ru.top100.tracker.kraken.di.Kraken.getData
import android.webkit.JavascriptInterface
//...
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val myWebView: WebView = findViewById(R.id.webViewIds)
myWebView.settings.javaScriptEnabled = true
myWebView.loadUrl("http://www.example.com")
myWebView.addJavascriptInterface(MyJavascriptInterface(), "kraken")
}
class MyJavascriptInterface {
@get:JavascriptInterface
val data: String
get() = getData()
}