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:
window.parent.window.android.close()
within iframe.- stored
window.androidclose = android.close
in variable insideindex.html
, called within iframewindow.parent.window.androidclose()
. - tried
postmessage
api message passing between iframe ,index.html
sending message , calling inside callbackwindow.addeventlistener('message', function() { android.close(); }, false);
Comments
Post a Comment