Hello,
I am working on adding a postmessage based API for Android Webview. We want the API to be similar to HTML5 postMessage:
public interface JsMessage {
// an ancestor for container classes that can be send as messages between Java and JS
}
public void postMessageToFrame(String frameId, JsMessage message, Uri targetOrigin);
Here, the first parameter frameId indicates which frame to send the message to, i.e.
<iframe id="foo" name="bar" src="iframe.html" onload="sendMsg()" ></iframe>
My question is, what would be the proper attribute to use here? The id or the name?
If id is the better choice, in chromium, is there any example code that I can follow to find a frame given the Id? (I think already cracked the name case).
Thanks,
-Selim