dimanche 29 mars 2015

Using postMessage() between Android and Website

I have a mobile App that navigate to website login page in new window using the following JS onclick:



window.open('https://URL', '_blank', 'location=yes');


The new window opens is as follows:


enter image description here


I need to populate the username in its field automatically. I found postMessage() method very suitable to do cross-domain communications (e.g., this example) . But I could not find any example of using it between Android and website.


Now I understand that I need to modify on both sides (i.e., source and destination) to use postMessage(). I understand the source side. My question is where exactly I need to modify at the destination side, given the page is default Joomla login page. I know where login form in the directory components/com_users/views/login/tmpl/default_login.php ,but I do not know if there where should I update and what exactly should I update there. Should I create iFrame? or I only need to add this method inside login form?


Aucun commentaire:

Enregistrer un commentaire