private boolean executeJavaScriptFunction ( final String function ) { List < WebView > webViews = viewFetcher . getCurrentViews ( WebView . class , true ) ; final WebView webView = viewFetcher . getFreshestView ( ( ArrayList < WebView > ) webViews ) ; if ( webView == null ) { return false ; } final String javaScript = setWebFrame ( prepareForStartOfJavascriptExecution ( webViews ) ) ; inst . runOnMainSync ( new Runnable ( ) { public void run ( ) { if ( webView != null ) { webView . loadUrl ( "javascript:" + javaScript + function ) ; } } } ) ; return true ; }
Executes the given JavaScript function