Skip to content

Instantly share code, notes, and snippets.

@dwiash
Forked from paulirish/XHR2.js
Created December 5, 2011 00:37
Show Gist options
  • Save dwiash/1431802 to your computer and use it in GitHub Desktop.
Save dwiash/1431802 to your computer and use it in GitHub Desktop.
XHR2 detects for testling
/*
trying out some XHR2 detects for https://github.com/Modernizr/Modernizr/issues/385
testling is awwwesome.
curl -u xxx@xxx \
-sSNT XHR2.js 'testling.com/?browsers=iexplore/6.0,iexplore/7.0,iexplore/8.0,iexplore/9.0,chrome/4.0,chrome/5.0,chrome/6.0,chrome/7.0,chrome/8.0,chrome/9.0,chrome/10.0,chrome/11.0,chrome/12.0,chrome/13.0,chrome/14.0,chrome/15.0,firefox/4.0,firefox/5.0,firefox/6.0,firefox/7.0,firefox/8.0,opera/10.0,opera/10.5,opera/11.0,opera/11.5,safari/5.0.5,safari/5.1,firefox/nightly,opera/next,chrome/canary'
*/
var test = require('testling');
test('XHR2', function (t) {
var progEv = !!(window.ProgressEvent);
var fdata = !!(window.FormData);
var wCreds = window.XMLHttpRequest && "withCredentials" in new XMLHttpRequest;
t.log(['window.ProgressEvent:', progEv])
t.log(['window.FormData:', fdata])
t.log(['WithCredentials:', wCreds]);
progEv && fdata && wCreds && t.log('XHR2 ALL THE things')
t.end();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment