How to trigger Android function in Javascript from within iframe in webview? -


i've android.close method being exposed jsbinding can called javascript in webview close it. however, i've iframe loads sample page inside index.html, webview renders. calling same method within iframe not trigger close webview.

what's solution?

i've tried following ways no luck:

  1. window.parent.window.android.close() within iframe.
  2. stored window.androidclose = android.close in variable inside index.html , called within iframe window.parent.window.androidclose().
  3. tried postmessage api message passing between iframe , index.html sending message , calling inside callback window.addeventlistener('message', function() { android.close(); }, false);


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -