How I can open a new tab in a Firefox add-on with POST variables?
For example, open http://localhost/ with these post variables:
a=NOMADE
b=NOWAY
another=IDONTKNOW
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The gBrowser.addTab function is what you want. One of the parameters you pass to that function is
postData, and allows you to set the postData as you would like it. The MDN documentation for that function also points to an article on pre-processing POST data. If I read that second article correctly, the POST data needs to be passed in the form of an nsIInputStream (specifically created as nsIMIMEInputStream). The article provides a sample code snippet for converting from a standard GET style format string (example:foo=1&goo=somestring) to the intended format.Edit: So, to use your example, you might do something like this: