title: Android WebView onPageFinished BUG
body: <p>After update API (27) in Android OREO this code is no longer working:</p>
  
  <pre><code> public void onPageFinished(WebView view, String url) {
       super.onPageFinished(view, url);
       view.loadUrl("javascript:(function() {document.getElementById(\"imPage\").style.display='none';})()");
   }
  </code></pre>
  
  <p>I have also tried with:</p>
  
  <pre><code>webView.loadUrl(
                      "javascript:(function() { " +
  
                              "document.addEventListener(\"DOMContentLoaded\", function(event) {" +
  
                              "document.getElementById(\"imPage\").style.display='none';" +
  
                              "});" +
  
                              "})()");
  </code></pre>
  
  <p>Element not hiding and debug return:</p>
  
  <pre><code>I/chromium: [INFO:CONSOLE(1)] "Uncaught TypeError: Cannot read property 'style' of null", source: mywebsite/ (1)
  </code></pre>
  
  <p>So I think the <code>javascript</code> is injected before loading page, this explains why the line is 1, because I have other code called after loading page is finished but this code is called when page is white, not loaded.</p>