Closed coder13 closed 7 years ago
This appears to be two-fold:
@jfly I don't know about other browser but at least on firefox (55.1.0) https://github.com/jfly/tnoodle/blob/b18452a361679dcff9b557e1feb8119b510aa203/webscrambles/WebContent/wca/scrambleserver.js#L333 can simply be changed to
if(json.error instanceof XMLHttpRequest) {
I was able to test that by killing the java backend during initialization. Can we confirm it works properly in other browsers?
I just tried this out on Chrome, and I can tell you that XMLHttpRequest
would not work for us there. See:
As you can see, in Chrome, json.error
is of type ProgressEvent
. The type of it is really XMLHttpRequest
in Firefox? That's unfortunate...
I'll try playing around with it tomorrow. The fields on the objects look similar so maybe we can use some form of duck typing to determine if it's what we want.
My new proposal for checking it is now:
json.error.currentTarget.constructor.name === "XMLHttpRequest"
Note that you'll probably need to check if some of those properties are defined (most notably currentTarget
)
Firefox 50.1.0 https://i.gyazo.com/f2331bedb0f5831255100bab9ba5cdb7.png Google Chrome 55.0.2883.87 https://i.gyazo.com/47eaabe5236644efc507cc751b6b2608.png
Cool! I will accept a PR that changes this =)
This happens on chrome Version 52.0.2743.33 beta (64-bit) I downloaded TNoodle-WCA-0.11.1.jar, ran it and after opening up the webpage in chrome, it says this Uncaught ReferenceError from line 333 of scrambleserver.js. This should be a frontend problem I believe but for what it's worth, I'm running ubuntu 16.04. I
This is my java version: