Using Safari Technology Preview Version 9.1.1 (11601.6.10, 11602.1.25), when I try using fetch:
fetch('/')
It returns a rejected promise:
Promise {status: "rejected", result: "Fetch is not yet implemented"}
Thanks for the report. We're following the nightly build progress, as fetch is implemented natively in Safari, too.
@dgraham Not sure I understand your response. Why does STP fail with "_Fetch is not yet implemented_" then (and how is this not a bug?)
The preview browser build provides a native window.fetch that isn't working yet. The polyfill won't override a native implementation so we see this in the console.
> window.fetch
< function fetch() {
[native code]
}
> fetch('/')
< Promise {status: "rejected", result: "Fetch is not yet implemented"}
Presumably the stubbed native window.fetch function will be fully implemented before shipping in a real Safari release.
This makes the Safari Technology Preview ... _much_ less useful, at best. To have a native implementation that fails is much worse than having none at all, since it also breaks polyfills (and any apps that rely on fetch to function).
Edit Thanks for the clarification! It's really unfortunate that STP took this route but I understand your POV.
FYI a released WebKit Bugzilla issue seems to be https://bugs.webkit.org/show_bug.cgi?id=151937
Thanks for the update @dgraham! :)
It was a pretty bad call on their part to provide a stubbed but useless window.fetch function, but let's stay hopeful for the next update. 馃憤
BTW you can force the polyfill taking place if you nulify window.fetch before loading the polyfill:
<script>
if (detectSafariPreview()) window.fetch = undefined
</script>
<script src="./fetch.js"></script>
The native fetch API has been disabled until it鈥檚 ready. The change is available in the newly released version 2 of STP. See the release notes.
Hey Guys, I have a problem with Safari version 10.0.1. I think that an is problem of compatibility. Someone had this same problem using JavaScript?
@pedropolisenso:
Hey @mislav
I'm sorry. I thought that had a problem, but the problem were on PC of the client. It was a problem with certification apple. Thank you!
Most helpful comment
https://twitter.com/jonathandavis/status/715315412791988225