In my application, I need to have a button which opens Firefox (if not already open), executes a POST request including a file upload, and displays the resulting page to the user (for further navigation).
From what I've found until now, this seems to necessitate the use of a Firefox extension like MozRepl or JSSH, so I can connect to the process via Telnet or SSH from my application. Are there other ways? I'm open to good suggestions...
I would then need to use content.XMLHttpRequest to create a POST request:
var req = new XMLHttpRequest();
req.open("POST", "http://myurl", true);
// [...]
req.send()
But what comes in [...]? There is somehow a File object that is built from local forms; but how can I instantiate and fill one myself? And how do I get the page results to show up in Firefox?
I can either write a temporary file to disk and read it from there, or write the file contents directly via Javascript/MozRepl, both are acceptable for me (but 1) probably not for Javascript).
Thanks in advance, -M.