XMLHttpRequest problem in Firefox extension I'm developing

The most likely cases from the outsides is that there is some error that only happens when you test it with pushing the button. That could be the request being malformed etc. Since you insist that dologin is called, it must be something that comes after that logging statement that is failing. A powerful way to find out would be to use the debugger and step through, or at least pause on network requests and any exceptions.

Since the button is not in a form I don’t think the page would be reloading, when you click it, right? I also noticed that your HTML may be invalid with things like two '' after the placeholder for the email input.