Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to enforce polyfill #170

Closed
KeKs0r opened this issue Jul 2, 2015 · 5 comments
Closed

Possibility to enforce polyfill #170

KeKs0r opened this issue Jul 2, 2015 · 5 comments

Comments

@KeKs0r
Copy link

KeKs0r commented Jul 2, 2015

Is there a possibillity to force the usage of the polyfill instead of the browser functionality?

@KeKs0r KeKs0r changed the title Possibility for force polyfill Possibility to enforce polyfill Jul 2, 2015
@dgraham
Copy link
Contributor

dgraham commented Jul 2, 2015

No, the polyfill cannot be forced to override native browser behavior. See #147 and #162 for more discussion.

@dgraham dgraham closed this as completed Jul 2, 2015
@STRML
Copy link

STRML commented Oct 14, 2016

This would be a very nice feature to have available somehow, even if it meant digging deep into internals. We are seeing non-spec-compliant behavior from Edge, such as #407 and missing request bodies on DELETE. For now we will simply fork.

@jimmywarting
Copy link

Native fetch also don't have support for response.body which the polyfill soon dose (once #404 gets accepted), So I agree that it would be useful to enforce the polyfill in browser that partially support fetch.

@STRML
Copy link

STRML commented Oct 14, 2016

I understand that the team doesn't want to introduce a build process or otherwise complicate this module, but given that we've now seen our first fundamentally broken fetch() implementation in the wild, it may be necessary.

I don't believe it's going to be possible to easily test for the broken PUT/PATCH/DELETE Content-Length functionality, so it would be really nice to have a UMD shim introduced.

@natergj
Copy link

natergj commented Mar 9, 2018

I would have to agree that the polyfill should not be implementing functionality for forcing usage. You can easily force usage of any polyfill in other ways. I recently had to get around a bug in MS Edge fetch implementation where it wasn't handling 401 responses correctly. My solution was just to unset window.fetch for MS Edge. After that, the polyfill worked as expected and set window.fetch to the polyfill version.

In the first <script> tag of the <head> section

if (navigator.userAgent.indexOf('Edge') !== -1) {
  window.fetch = undefined;
}

as long as that is executed before the fetch polyfill code, you're golden.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants