-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add polyfills for older browser versions
- Add AbortController polyfill for Safari 10 - 11 and Firefox 52 - 56 - Was going to add fetch polyfill but it is only missing from Safari 10.0. It is in Safari 10.1 and all other browsers that need to be supported. All Safari before 10.1 is only 0.26% of all browsers usage. It is not possible to test Safari 10.0 on Browserstack and the complexity and size cost of adding the polyfill for this one minor version is large, so it was skipped it. Including the one polyfill brings the size of the built package to 232K up from 220K.
- Loading branch information
Showing
4 changed files
with
668 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
var AbortController = require('abort-controller'); | ||
|
||
// istanbul ignore next | ||
module.exports = typeof window === 'undefined' ? AbortController : window.AbortController; | ||
// istanbul ignore file | ||
if (typeof window === 'undefined') { | ||
module.exports = require('abort-controller'); | ||
} else { | ||
if ('signal' in new Request('')) { | ||
module.exports = window.AbortController; | ||
} else { | ||
var polyfill = require('abortcontroller-polyfill/dist/cjs-ponyfill'); | ||
module.exports = polyfill.AbortController; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.