-
Notifications
You must be signed in to change notification settings - Fork 20.6k
Simplify XHR detection #1967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sounds like a great idea; I only see references to it in test/unit/support.js and those can go away as well since we don't guarantee any |
Right, but you can disable it in IE, but i'd say we shouldn't support that anymore.
Not sure about /cc @jaubourg |
|
I tend to agree, especially on
IMO we should keep it. Our detection code is not perfect in weird setups so it's nice if people can workaround potential problems just by setting |
Hence the
We should definitely keep |
Does IE with native XHR disabled still have the |
(on a side note, we also need to think about those non-browser environments that may not have an xhr implementation into which we may not want to fail miserably)
Whether it's |
Right; I'll land #1949 in a moment so that we get covered here. |
Right but if it never throwed then it'd be better to avoid |
Exactly. The module we're talking about being ajax, I tend to apply a "better safe than sorry" policy ;) |
I've checked IE11 — you just cannot disable |
Checked IE9: even when you disable |
Then we should document and support it, otherwise we will face more problems in the future. But i wouldn't do that, the only reason i see to leave it in, is for the tests. Besides, there are way to do that, documented way. Whereas setting @jaubourg it would be interesting to see in what unsupported envs we would fail, if we would, it would be on the low amount of users, but if we wound't, then we could avoid the "just in case" code. |
We have too many undocumented edges and I would like to reduce them. |
Second thought: why not just remove |
We'll investigate further for 3.1.0. |
Previously, jQuery.ajaxSettings.xhr, contents were wrapped in a try-catch as we defined jQuery.support.ajax & jQuery.support.cors executed during the jQuery load and we didn't want to crash if IE had native XHR disabled (which is possible). While jQuery hasn't supported the ActiveX-based XHR since 2.0, jQuery with XHR disabled could still be used for its other features in such a crippled browser. Since jquerygh-4347, jQuery.support.ajax & jQuery.support.cors no longer exist, so we don't need the try-catch anymore. Fixes jquerygh-1967 Ref jquerygh-4347
Previously, jQuery.ajaxSettings.xhr, contents were wrapped in a try-catch as we defined jQuery.support.ajax & jQuery.support.cors executed during the jQuery load and we didn't want to crash if IE had native XHR disabled (which is possible). While jQuery hasn't supported the ActiveX-based XHR since 2.0, jQuery with XHR disabled could still be used for its other features in such a crippled browser. Since jquerygh-4347, jQuery.support.ajax & jQuery.support.cors no longer exist, so we don't need the try-catch anymore. Fixes jquerygh-1967 Ref jquerygh-4347
Previously, jQuery.ajaxSettings.xhr, contents were wrapped in a try-catch as we defined jQuery.support.ajax & jQuery.support.cors executed during the jQuery load and we didn't want to crash if IE had native XHR disabled (which is possible). While jQuery hasn't supported the ActiveX-based XHR since 2.0, jQuery with XHR disabled could still be used for its other features in such a crippled browser. Since gh-4347, jQuery.support.ajax & jQuery.support.cors no longer exist, so we don't need the try-catch anymore. Fixes gh-1967 Closes gh-4467 Ref gh-4347
This is the
XMLHttpRequest
object detection code:https://github.com/jquery/jquery/blob/master/src/ajax/xhr.js
support.ajax
is used nowhere in the code and is not documented,XMLHttpRequest
object is supported in all modern browsers (including Android 2.3, iOS 6.1, Opera 12 and IE 9 — caniuse.com).Why not remove
xhrSupported
variable together withsupport.ajax
andtry-catch
block?The text was updated successfully, but these errors were encountered: