Skip to content
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
Closed

xmlhttprequest level 2 support #385

aeosynth opened this issue Sep 29, 2011 · 10 comments

Comments

@aeosynth
Copy link

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
Copy link
Member

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
Copy link
Author

XMLHttpRequest Level 2

@aeosynth
Copy link
Author

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
Copy link
Member

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
Copy link
Member

trying this on testling...

@paulirish
Copy link
Member

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
Copy link
Member

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
Copy link

Yaffle commented Feb 26, 2012

opera 12 added ProgressEvent - http://my.opera.com/desktopteam/blog/2012/02/10/core-dnt-mail-themes

@paulirish
Copy link
Member

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
Copy link
Member

fixed!

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
Projects
None yet
Development

No branches or pull requests

3 participants