In the Android code I'm trying to get Tab.getWebContents().evaluateJavaScript() to work.
Here is what I have:
1. I selected this tab-observer in file src/chrome/browser/tab/java/src/org/chromium/chrome/browser/tab/EmptyTabObserver.java
2. Inside function public void onPageLoadFinished(Tab tab, GURL url) I added this code:
if (url.getSpec().contains("
bing.com"))
{
tab.getWebContents().evaluateJavaScript("(function() {" + " alert('hello!');" + "})()", null);
}
3. Chromium builds, installs, and runs fine on my Android Pixel. However when I navigate to bing to test this the app just crashes. This confirms that the code IS getting hit but what do I have wrong?