Exclude Safari when validating if AbortController exists #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
As reported on #23, Safari claims to support
AbortController
, but while the object is indeed present, calling.abort()
doesn't do anything.@mo tested it on the technical preview and the issue is still there, so the easiest solution we came up with is, on Safari, apply the polyfill even if
AbortController
exists.How should it be tested?
I created this sandbox with a simple script that creates a request and aborts it right away.
You can test how it works on other browsers but doesn't on Safari.
In order to test the fix, you can:
npm run build
.dist
to the sandbox'snode_modules/abortcontroller-polyfill
(or usenpm/yarn link
).npm start
on the sandbox.Notes
RegExp
a little bit because Chrome's user agent also ends withSafari/...
.Failed: unknown error: call function result missing 'value'
, and since there wasn't a Selenium script for Safari (and I not any good with Selenium), I didn't test the change.