title: Javascript not working on Android WebView while it was working before updating to target sdk 29
body: <p>I am loading the content of a local html file into a WebView:</p>
  
  <pre><code>context?.assets?.open("SeatingPlan.html")?.bufferedReader().use {
          val some = it?.readText()
          some.let {
              val finalHTML = some!!.replace("{PERFORMANCE-ID}", occurrence.id.toString())
              binding.webView.addJavascriptInterface(SeatingPlanWebAppInterface { ticketData: String -&gt;
                  handleTicketSelection(ticketData)
              }, "Android")
              binding.webView.loadData(finalHTML, "text/html; charset=utf-8", "UTF-8")
          }
      }
  </code></pre>
  
  <p>Then, I have a listener so as I will trigger some javascript functions once the loading is finished as follows: </p>
  
  <pre><code>binding.webView.settings.javaScriptEnabled = true
      binding.webView.webViewClient = object : WebViewClient() {
          override fun onPageFinished(view: WebView, url: String) {
              super.onPageFinished(view, url)
              binding.webView.loadUrl("javascript:(function() {" + "document.addEventListener('LTD.SeatPlan.OnSeatSelected', e =&gt; {Android.seatSelected(JSON.stringify(e.detail))});" + "document.addEventListener('LTD.SeatPlan.OnSeatUnselected', e =&gt; {Android.seatUnSelected(JSON.stringify(e.detail))});" + "})();")
          }
      }
  </code></pre>
  
  <p>The same code has been working well for all supported android versions of my app (5.0+), while now, after updating to target sdk 29 it gets stuck in loading the html and instead it shows a blank white screen.</p>
  
  <p>I am thinking that the issue may be related to the changes made for <code>SDK</code> 29 , but don't know where else to look for a solution. The reason I am thinking it may be the target <code>SDK</code> 29 the issue is because of the latest changes relating to the <code>WebView</code> that were made: <a href="https://developer.android.com/about/versions/pie/android-9.0-migration" rel="noreferrer">https://developer.android.com/about/versions/pie/android-9.0-migration</a>. Is there a workaround?</p>