cocos2d-html5 icon indicating copy to clipboard operation
cocos2d-html5 copied to clipboard

Fix Ajax NS_ERROR_FAILURE in Firefox

Open seagullua opened this issue 9 years ago • 1 comments

Firefox will fire NS_ERROR_FAILUER exception if we access xhr.status field in some situation. More: http://helpful.knobs-dials.com/index.php/0x80004005_(NS_ERROR_FAILURE)_and_other_firefox_errors

This fix adds try catch to catch possible errors in Firefox.

seagullua avatar Jul 10 '16 20:07 seagullua

Thanks for the info, the most important thing I noticed in your link is:

The W3 specs tell you that you shouldn't try to read status in the onerror handler because for some problems it may not be set, and that accessing it must (!) then lead to an exception raise.

I think we should simply remove status access in onerror handler, to be honest, we don't like try catch, it has its own cost and it will prevent the whole function from being compiled by JIT.

pandamicro avatar Jul 18 '16 05:07 pandamicro