title: Android webview custom JS not get message from postMessage call
body: <p>I use my nodejs server with passport to provide 3rd party auth.  I setup a WebView on my Anrdroid client to load the following html:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;script src="file:///android_asset/oauth.js" type="text/javascript"&gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>With this javascript:</p>
  
  <pre><code>Android.callit('Loaded javascript file');
  
  window.addEventListener('message', function(event) {
    Android.callit('got message event');
  
    authWindow.close();
  }, false);
  
  var authWindow = window.open("https://myserver/twitter/signin", "");
  </code></pre>
  
  <p>After successful auth to a third party server my nodejs server redirects to a page like this:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;script&gt;window.opener.postMessage({"auth":true}, '*');&lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is my Activity that starts the webview:</p>
  
  <pre><code>public class OAuthActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.oauth);
  
          WebView webView = (WebView) findViewById(R.id.webView);
          webView.getSettings().setJavaScriptEnabled(true);
          webView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
          webView.addJavascriptInterface(new JSInterface(), "Android");
          webView.setWebViewClient(new WebViewClient() {
              public void onReceivedSslError(WebView webView, SslErrorHandler handler, SslError error) {
                  handler.proceed();
              }
  
              @Override
              public boolean shouldOverrideUrlLoading(WebView view, String url) {
                  view.loadUrl(url);
                  return true;
              }
          });
  
          webView.loadUrl("file:///android_asset/oauth.html");
      }
  
      public class JSInterface {
          @JavascriptInterface
          public void callit(String with) {
              Log.i("TEST", with);
          }
      }
  }
  </code></pre>
  
  <p>So why is the 'message' event never firing?</p>
  
  <p>As a note I have done this in a browser and it works fine.  Just not when I try and use it in an android webview.</p>