Commit Graph

19 Commits

Author SHA1 Message Date
John Hiesey 0887fcf0b4 Major cleanup to remove IE10 and earlier support 2018-09-24 14:09:42 -07:00
John Hiesey f94670b6b4 Add proper abort/timeout support for fetch
Fixes #26, finally!
2018-01-15 01:03:26 -08:00
John Hiesey 46c35150fc Implement backpressure
Uses WritableStream, which is still quite new.
2018-01-15 01:03:07 -08:00
Feross Aboukhadijeh 43761f2799 Avoid xhr request to example.com if fetch is supported
For: https://github.com/brave/browser-laptop/issues/5981
2017-01-10 22:17:09 -08:00
John Hiesey e8ef98b286 style consistency 2017-01-06 01:04:07 -10:00
Dominic Tarr 1b077bf249 if xhr.open throws, then no xhr is allowed 2016-12-09 21:04:31 +01:00
Mikeal Rogers 0a04a09f68 Adding support for Service Workers. 2016-11-16 19:18:19 -08:00
John Hiesey 4e7103a5a9 Fix feature testing on IE
The previous commit broke IE<=9, since xhr doesn't work cross-domain.
When XDomainRequest is available, use the current page instead of
example.com
2016-10-27 20:03:14 -07:00
John Hiesey 34aa684789 Always use example.com for feature testing
Previously, there was some logic to use the page host
when possible, but it was problematic still (e.g. #53).

Just use example.com in all cases instead. Since the
request is never sent, this shouldn't cause extra
network traffic (except perhaps a dns lookup).

Fixes #53
2016-10-27 19:05:25 -07:00
John Hiesey 9c18855feb Check for ReadableStream instead of ReadableByteStream
ReadableByteStream was removed from the spec and from
Chrome 51. Fixes #46
2016-07-27 14:24:51 -07:00
John Hiesey 8cab16f26e Change window to global for WebWorker support 2015-09-14 18:18:53 -07:00
John Hiesey a91ed0db64 Modify feature testing to avoid warnings in Chrome
Previously, testing for 'ms-stream' and 'moz-chunked-arraybuffer'
support on the xhr object caused warnings to appear in Chrome.
Since fetch will always be used instead of these when available,
short-circuit and return false when fetch is available.
2015-08-20 01:06:34 -07:00
John Hiesey da4085e33d Make content-type header correct by default
The default behavior now preserves the 'content-type' header, at
the expense of not providing pseudo-streming in Safari, generic
WebKit, and older Chrome. Applications that require streaming
and already use 'prefer-stream' mode will not be affected.

The 'prefer-fast' mode is now deprecated, as that behavior now
matches the default. The 'allow-wrong-content-type' mode is new;
it gives the same behavior as the old default in case binary
streaming is essential.

Fixes #8
2015-08-20 01:01:40 -07:00
John Hiesey 221ce6d7bd Merge remote-tracking branch 'bendrucker/no-util' 2015-07-12 15:14:09 -07:00
John Hiesey 4232780821 Add POST tests and fix test failures 2015-07-07 16:35:16 -07:00
Ben Drucker 3f96e0550b Replace util.inherits with inherits module
Also inlines util.isFunction

Reduces bundle size by not including extraneous code
2015-07-03 09:21:06 -04:00
John Hiesey 8985094a2b Support binary requests in IE9 2015-07-02 20:00:16 -07:00
John Hiesey db953820d0 Fix arraybuffer mode 2015-07-02 18:18:43 -07:00
John Hiesey c779668f86 repo cleanup 2015-07-02 14:44:13 -07:00