我正在用ionic开发一个应用程序,并且刚刚插入了这个Content-Security-Policy元标签。
<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在设备上根本不起作用。

我的错误是什么?
发布于 2016-08-04 23:16:40
看起来您需要一个显式的URI方案,如下所述:
content security policy error, but meta-tag includes URL
因此,像这样的东西应该是有效的:
<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">https://stackoverflow.com/questions/38766985
复制相似问题