I have below code to send string from Firefox addon to MySQL. It works if I run by console i.e. I get data in MySQL. But when I add it to the extension it doesn't work. Even the line above of this script in the extension (which write text to a text file) runs i.e. write to that text file.
I referred below links
XMlHttpRequest is not working in Firefox extension
How to use jQuery in Firefox Extension
Adding Jquery and Other JS libraries to Firefox Extension
var http = new XMLHttpRequest();
http.open("GET", "http://localhost/todayreport/ajax.php?firefoxaddondata=data", true);
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.setRequestHeader("Connection", "close");
http.send();