User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:69.0) Gecko/20100101 Firefox/69.0
Steps to reproduce:
responseType of an XHR after calling
send() (which is illegal):
var x = new XMLHttpRequest();
x.open("GET", location, false);
var a = x.send();
x.responseType = "arraybuffer";
Example taken from https://searchfox.org/mozilla-central/rev/40ef22080910c2e2c27d9e2120642376b1d8b8b2/dom/tests/mochitest/bugs/test_onerror_message.html#59-62
InvalidStateError: XMLHttpRequest state must not be LOADING or DONE.
Firefox should have told the user/developer what it is they did wrong.
Currently, the error message looks like an internal Firefox error, instead of like a user mistake.
This can lead to confusion, like in bug 1540574.
Other browsers do this better. For example, Chromium shows this:
Uncaught DOMException: Failed to set the 'responseType' property on 'XMLHttpRequest': The response type cannot be set if the object's state is LOADING or DONE.
This states what the user did and why it's illegal.
We should improve it in Firefox to be similar.