title: Using postMessage() between Android and Website
body: <p>I have a mobile App that navigate to website login page in new window using the following JS onclick:</p>
  
  <pre><code>window.open('https://URL', '_blank', 'location=yes');
  </code></pre>
  
  <p>The new window opens is as follows:    </p>
  
  <p><img src="https://i.stack.imgur.com/Qmhlm.jpg" alt="enter image description here"></p>
  
  <p>I need to populate the username in its field automatically. I found postMessage() method very suitable to do cross-domain communications (e.g., this <a href="http://blog.teamtreehouse.com/cross-domain-messaging-with-postmessage" rel="nofollow noreferrer">example</a>) . But I could not find any example of using it between Android and website.</p>
  
  <p>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 about the destination as I'm not familiar with Joomla nor I'm familiar with PHP. So the 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 <code>components/com_users/views/login/tmpl/default_login.php</code> ,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? </p>