Ionic 3 Inapp browser communication problem with app . How to take value?

Dear pals,

I saw a post with URL here to take cross browser window communication.
I try same strategy for a payment with inapp web browser. The web provide
one local storage value . It’s source is

                                <table width="500" border="0" align="center" valign="top">
                                      <td colspan="4">&nbsp;</td>
                                      <td height="27" colspan="4" align="center"><b>Transactions completed. Click Back button to redirect</b></td>
                                      <td height="27" colspan="4" align="center"><a href="#" onclick="closew();">Click here to redirect</a></td>
                                    <tr><td width="75"></td>
                                 <input type="hidden" id="epayReceiptNo" name="epayReceiptNo" value="6029011000001">
                        <script type="text/javascript">
                        function setParameters()
                                var receiptno = document.getElementById('epayReceiptNo').value;
                                localStorage.setItem('epayReceiptNo', receiptno);   
                        function closew()
                            open(location, '_self').close();

in my pay.ts file i tried

var pageContent ='<html><head></head><body><form id="paymentForm" action="" method="post">'+
                  '<input type="hidden" name="BID" value="'+numBuildingID+'">'+
                  '<input type="hidden" name="LBID" value="'+lbid+'">'+
                  '<input type="hidden" name="ZoneID" value="'+zone+'">'+
                  '<input type="hidden" name="WardYear" value="'+wardyear+'">'+
                  '<input type="hidden" name="Category" value="'+intBuildingCategory+'">'+
                  '<input type="hidden" name="HashKey" value="'+hash+'">'+
                  '<input type="hidden" name="transactionID" value="'+trid+'">'+
                  '<input type="hidden" name="Mode" value="SAMAGRA">'+
                  '<form><script type="text/javascript">document.getElementById("paymentForm").submit();</script></body></html>';
  var pageContentUrl = 'data:text/html;base64,'+btoa(pageContent);
  var browserRef =,"_blank","EnableViewPortScale=yes");
  browserRef.addEventListener( "loadstop", function() {
        { code: "localStorage.getItem( 'epayReceiptNo' )" },
        function( values ) {
            alert( values[ 0 ] );

But I could not get any result. Please advise …