capacitor-inappbrowser icon indicating copy to clipboard operation
capacitor-inappbrowser copied to clipboard

Can i add text/html;ba64 as url?

Open Gautammer opened this issue 2 years ago • 1 comments

Like this?

var pageContent = '<html><head></head><body><form id="loginForm" action="' + url + '" method="post">' +
    '<input type="hidden" name="username" value="' + this.userName + '">' +
    '<input type="hidden" name="pwd" value="' + this.decryptedPass + '">' +
    '<input type="hidden" name="mobile_token" value="123xyz">' +
    '</form> <script type="text/javascript">document.getElementById("loginForm").submit();</script></body></html>';


  var pageContentUrl = 'data:text/html;base64,' + btoa(pageContent);
  
  InAppBrowser.open({
     url:pageContentUrl,
     headers:{
        backgroundColor:'#ffffff'
     },
     isPresentAfterPageLoad:true
  }).then(res=>{
    console.log(res);
  },err=>{
    console.log(err);
  })
  

Thanks :)

Gautammer avatar Mar 02 '23 14:03 Gautammer

Hello thanks for the answer i'm not sure it's supported by the native browser of platform, but the best is you to try !

riderx avatar Mar 06 '23 15:03 riderx