I want to integrate an existing website into my webview but also override a javascript function that exists on this website with my own version? Then I can use the java-javascript bridge. I have tried using the following but it seems to execute the function only
webView.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url) {
super.onPageFinished(view, url);
webView.loadUrl("javascript: (function myFunc() { "
+ "alert('overriden alert ha!');"
+ "})()");
}
});