由于 iOS 12 Safari 阻止我的 url 请求凭据,因为它是跨域请求。 iOS 11 一切正常。所以我认为所有标题都设置正确。
控制台输出为:
Blocked *URL* from asking for credentials because it is a cross-origin request.
我在发行说明中找不到任何表明可能发生了变化的内容。
https://developer.apple.com/documentation/safari_release_notes/safari_12_release_notes
你们中有人知道 Apple 在 Safari 12 中进行了哪些更改以提高安全性/阻止跨域请求索取凭据吗?
谢谢你的帮助!
最佳答案
添加 crossorigin
根据 this answer 到 script 元素应该解决这个问题.
例子:
<script src="my-code.js" type="module" crossorigin></script>
另见 https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes
关于ios - Safari 阻止 URL 请求凭据,因为它是跨域请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55131037/