I am trying to use JS to launch a URL in internet explorer via POST request from any other browser (i.e. open IE from firefox/chrome/safari)
My website runs in google chrome. In one of my methods, i post a request to client's API and it returns me a URL to another website. The client requires me to auto launch this URL in Internet Explorer via POST request. Now I know how to launch a URL through post request, but it launches the URL in a new window of google chrome. My question here is that how can I launch this URL via POST in Internet Explorer?
I am using the following code to open this url through post request in new window of chrome.
function OpenWindowWithPost(url, windowoption, name, params) {
var form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", url);
form.setAttribute("target", name);
for (var i in params) {
if (params.hasOwnProperty(i)) {
var input = document.createElement('input');
input.type = 'hidden';
input.name = i;
input.value = params[i];
form.appendChild(input);
}
}
document.body.appendChild(form);
window.open("post.htm", name, windowoption);
form.submit();
document.body.removeChild(form);
}
OpenWindowWithPost(onlyUrl,
"width=730,height=345,left=100,top=100,resizable=yes,scrollbars=yes",
"NewFile", paramsAsObject);
I also tried launching IE through protocol handler. (followed this post for protocol handler solution) Open Internet Explorer from Chrome using a protocol handler (ie:url)
but it just ignores my params and launches just the base URL in IE, which is not what i want.
Is there a way i can do both the things at one time? 1- open the given URL in IE. 2- open it via POST request.
Note: I cannot use GET/Href here due to client's requirements.
Any help would be much appreciated.