首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >http-equiv -Security-Policy适用于浏览器,但不适用于android设备- IONIC

http-equiv -Security-Policy适用于浏览器,但不适用于android设备- IONIC
EN

Stack Overflow用户
提问于 2016-08-04 20:11:55
回答 1查看 958关注 0票数 1

我正在用ionic开发一个应用程序,并且刚刚插入了这个Content-Security-Policy元标签。

代码语言:javascript
复制
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' fonts.googleapis.com 'unsafe-inline'; script-src 'self' code.jquery.com cdn.firebase.com  www.gstatic.com maps.googleapis.com localhost:35729 apis.google.com 'unsafe-inline' 'unsafe-eval' https://domain.com">

我没有在浏览器中得到任何错误,但在android设备上得到了很多错误。我在用人行横道。

本地chrome中没有错误,但当我使用chrome:// these检查应用程序并在设备上运行它时,我得到了以下错误:

因此,Content-Security-Policy在设备上根本不起作用。

我的错误是什么?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-08-04 23:16:40

看起来您需要一个显式的URI方案,如下所述:

content security policy error, but meta-tag includes URL

因此,像这样的东西应该是有效的:

代码语言:javascript
复制
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' https://fonts.googleapis.com 'unsafe-inline'; script-src 'self' https://code.jquery.com https://cdn.firebase.com  https://www.gstatic.com https://maps.googleapis.com localhost:35729 https://apis.google.com 'unsafe-inline' 'unsafe-eval' https://domain.com">
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/38766985

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档