Description
Bug Report
I am using inappbrowser plugin (v4.0.0) to redirect to external url, and trying to post data to the url through a form. It works fine in UIWebview, but when i upgraded to wkwebview it is failing.
let formContent = '<form action="' + URL + '" name=“myForm” id="myForm" method="post" target="secureiframe">';
let element = document.createElement("div");
let hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", “username”);
hiddenField.setAttribute("value", “test”);
element.appendChild(hiddenField);
formContent += element.innerHTML;
formContent += "< /form>";
let formContentUrl = 'data:text/html;base64,' + btoa(formContent);
let options = {location: 'no', usewkwebview: 'yes'}
var browser = this.inAppBrowser.create(formContentUrl, "_blank", options);
browser.on('loadstop').subscribe(event => {
browser.executeScript({code:"document.getElementById('myForm').submit();"} );
});
What is expected to happen?
Expected to post the form data to the url.
What does actually happen?
The form post data are ignored while redirecting.
Information
Environment, Platform, Device
IOS with Wkwebview
Version information
Cordova: Cordova CLI 9.0.0
Other Frameworks: Ionic 3.9.5 and CLI version 6.0.0
Operating System, Android Studio, Xcode etc.
Checklist
- [ x] I searched for existing GitHub issues
- [ x] I updated all Cordova tooling to most recent version
- [ x] I included all the necessary information above