- Source:
Methods
polyfillFetch(forceopt, nullable)
Polyfills window.fetch with a simple XMLHttpRequest-based implementation adapted from "unfetch", to provide basic functionality with a compatible signature while keeping the source as small as possible.
This polyfill should cover most basic use cases, but for complex cases you might need to polyfill something more complete (for example Github's implementation: https://github.com/github/fetch).
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
force |
Boolean |
<optional> <nullable> |
false | if true, replaces a possibly present native implementation with the polyfill as well |
- Source:
- See:
Example
polyfillFetch(true);