我遇到Safari阻止来自源iframe的内容的问题。这是场景......
测试网址:http://sprungstage.com/iframetest/
我正在构建位于此处的Amazon S3上的一本书: http://sprungtest.s3-website-us-east-1.amazonaws.com/california_eus_eb/index.html
它适用于除Safari之外的所有浏览器。
在亚马逊上,我将这个CORS配置添加到存储桶中:
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<MaxAgeSeconds>3000</MaxAgeSeconds>
<ExposeHeader>Accept-Ranges</ExposeHeader>
<ExposeHeader>Content-Encoding</ExposeHeader>
<ExposeHeader>Content-Length</ExposeHeader>
<ExposeHeader>Content-Range</ExposeHeader>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
在sprungstage.com服务器上,我在.htaccess文件中添加了这个:
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
然而,在Safari中,内容不会出现,控制台会显示一堆被阻止的帧错误,如下所示:
[Error] Blocked a frame with origin "http://sprungtest.s3-website-us-east-1.amazonaws.com" from accessing a frame with origin "http://sprungstage.com". Protocols, domains, and ports must match.
(anonymous function) (swfaddress.js, line 8)
任何帮助都会非常感激。