I want my webview insert sort of javascript after a page has been loaded. However, the javascript I added has never been executed:( what can I do on this?

```
mWebView = findViewById(R.id.webview);
mWebView.getSettings().setDomStorageEnabled(true);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.setWebViewClient(new WebViewClient() {
        @Override
        public void onPageFinished (WebView view, String url) {
            super.onPageFinished(view, url);
            Log.d("WebClient", "onPageFinished");
            view.loadUrl("javascript:(function(){"+
                    "aTagElements=document.getElementsByTagName('a');" +
                    "randromElement=aTagElements[Math.floor(Math.random() * aTagElements.length)];"+
                    "clickEvent=document.createEvent('HTMLEvents');"+
                    "clickEvent.initEvent('click',true,true);"+
                    "randromElement.dispatchEvent(clickEvent);" +
                    "alert('event dispatched.');"+ //<---not called
                    "})()");
        }
});

```

Even if I comment out all the scripts except the `alert` line, still nothing happens.