Ionic framework 三个js textureloader在Ionic App的iframe中显示从S3 Bucket加载数据的CORS错误
这是我的三个JS代码:Ionic framework 三个js textureloader在Ionic App的iframe中显示从S3 Bucket加载数据的CORS错误,ionic-framework,amazon-s3,iframe,three.js,cors,Ionic Framework,Amazon S3,Iframe,Three.js,Cors,这是我的三个JS代码: var aws_image_path = "path-to-aws-s3-bucket-image" myTextureLoader = new THREE.TextureLoader(); myMap = myTextureLoader.load(aws_image_path) // Further I used myMap for SpriteMaterial. 此代码在web浏览器中使用正常工作https://my_url/ 我在angular
var aws_image_path = "path-to-aws-s3-bucket-image"
myTextureLoader = new THREE.TextureLoader();
myMap = myTextureLoader.load(aws_image_path)
// Further I used myMap for SpriteMaterial.
此代码在web浏览器中使用正常工作https://my_url/
我在angular应用程序的iframe中添加此URL
我的爱奥尼亚密码是:
<ion-grid>
<ion-row>
<ion-col>
<iframe class="iframe" [src]="https://my_url/" allow="camera;microphone"></iframe>
</ion-col>
</ion-row>
</ion-grid>
AWS CORS配置:
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>HEAD</AllowedMethod>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
*
头
得到
放
邮递
删除
*
我在IFRAME中使用了domsanizer,但显示了相同的错误。父文档是否也在相同的
https://my_url/
domain作为iFrame文档?这似乎与CORS配置特别相关,而与任何标记为(icon framework
,three.js
)的库无关,虽然我会保留amazon-s3
,因为可以针对该服务制定解决方案。父文档是否也在同一https://my_url/
domain作为iFrame文档?这似乎与CORS配置特别相关,而与任何标记的库无关(icon-framework
,three.js
),尽管我会将amazon-s3
留在原地,因为可以针对该服务制定解决方案。
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>HEAD</AllowedMethod>
<AllowedMethod>GET</AllowedMethod>
<AllowedMethod>PUT</AllowedMethod>
<AllowedMethod>POST</AllowedMethod>
<AllowedMethod>DELETE</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>