0
由於違反CSP,我在Chrome應用程序中使用角度時遇到問題。我試圖哈希添加到內嵌標籤,但應用不承認CSP清單關鍵使用sha for chrome應用程序中的CSP inline <script> tag(angular)
There were warnings when trying to install this extension:
*Unrecognized manifest key 'Content-Security-Policy'.
的代碼,這使得一個問題是
<script>System.import('main.js').catch(function(err){ console.error(err); });</script>
Manifest.js的一部分
{
"name": "test-app",
"version": "0.1",
"description": "Test.",
"manifest_version": 2,
"minimum_chrome_version": "40.0.2213.0",
"app": {
"background": {
"scripts": ["background.js"]
}
},
"permissions": ["usb"],
"icons": {
"128": "icon_128.png"
},
"Content-Security-Policy": "script-src 'sha256qznLcsROx4GACP2dm0FCKCzCG+HiZ1guq6ZZDob/Tng='"
}
問題是:如何爲Chrome應用程序使用SHA(CSP在應用程序中被強制使用,但不在擴展中) 任何想法如何使其工作,或如何忽略該腳本以使其工作(其對於角度b oostraping)
我已經讀過https://developer.chrome.com/extensions/contentSecurityPolicy
和https://www.w3.org/TR/2015/CR-CSP2-20150721/#script-src-hash-usage
,但它是無果而終