Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can i add text/html;ba64 as url? #24

Open
Gautammer opened this issue Mar 2, 2023 · 1 comment
Open

Can i add text/html;ba64 as url? #24

Gautammer opened this issue Mar 2, 2023 · 1 comment

Comments

@Gautammer
Copy link

Gautammer commented Mar 2, 2023

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 :)

@riderx
Copy link
Contributor

riderx commented Mar 6, 2023

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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants