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

xmlhttprequest level 2 support #385

Closed
aeosynth opened this Issue Sep 29, 2011 · 10 comments

Comments

Projects
None yet
3 participants
@aeosynth

aeosynth commented Sep 29, 2011

https://github.com/Modernizr/Modernizr/blob/master/test/caniuse.html#L728-730

var progEv = !!(window.ProgressEvent);
var fdata = !!(window.FormData);
setResult('xhr20', (progEv && fdata));
@paulirish

This comment has been minimized.

Member

paulirish commented Oct 24, 2011

i've seen other XHR2 tests that just look for 'WithCredentials in window.XMLHTTPRequest`

can you look into which is best?
also can you link up the spec pretty plz :)

@aeosynth

This comment has been minimized.

aeosynth commented Oct 25, 2011

@aeosynth

This comment has been minimized.

aeosynth commented Oct 25, 2011

can you look into which is best?

define best. theoretically all of the added features should be checked:

http://www.w3.org/TR/XMLHttpRequest2/#differences

Differences from XMLHttpRequest

XMLHttpRequest Level 2 adds the following new features:

  • The ability to make cross-origin requests.
  • The ability to make anonymous requests — Referer, origin, and credentials are not part of the request.
  • The ability to register for progress events. Both for downloads (put listeners on the XMLHttpRequest object itself) and uploads (put listeners on the XMLHttpRequestUpload object, returned by the upload attribute).
  • The ability to override the media type and character encoding of the response through the overrideMimeType() method.
  • The ability to set a timeout for the request.
  • The ability to transfer ArrayBuffer, Blob, File and FormData objects.
  • The responseType and response attributes.
@paulirish

This comment has been minimized.

Member

paulirish commented Oct 25, 2011

welllll..
ideally we see if there is a heuristic which is indicative of all those.. or at least all those features that you'd care about.

it's a bit of an inference but that's kinda what we gotta do.. otherwise we're doing conformance testing against the spec.

@paulirish

This comment has been minimized.

Member

paulirish commented Dec 4, 2011

trying this on testling...

@paulirish

This comment has been minimized.

Member

paulirish commented Dec 4, 2011

just tested everything and if a browser supports one of the 3 it supports ALL of them.
EXCEPT for Opera Next.. which supports WithCredentials and FormData but not ProgressEvent so........

shrug

@paulirish

This comment has been minimized.

Member

paulirish commented Jan 29, 2012

we need a network-xhr2.js for feature-detects/

and hopefully by the time opera 12 ships they have ProgressEvent

which means we can just ask for one of these..

btw my gist.. https://gist.github.com/1431660#file_xhr2.js and results in a comment blow.

@Yaffle

This comment has been minimized.

Yaffle commented Feb 26, 2012

@paulirish

This comment has been minimized.

Member

paulirish commented Feb 27, 2012

thx for reporting! wooo

https://gist.github.com/1431660#file_xhr2.js

we can use any three of those as an XHR2 test now. PRs accepted!

@paulirish

This comment has been minimized.

Member

paulirish commented May 11, 2012

fixed!

@paulirish paulirish closed this in 22912a1 May 11, 2012

patrickkettner pushed a commit to patrickkettner/Modernizr that referenced this issue Feb 22, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment