我試圖加載谷歌地圖和firebaseio的許多方面都沒有成功: 這是我現在有:phonegap + ionic使用Content-Security-Policy加載maps.googleapis.com,如何?
<meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: https://ssl.gstatic.com;
script-src 'self' https://maps.googleapis.com/* 'unsafe-inline' 'unsafe-eval';
style-src 'self' 'unsafe-inline';">
,我也得到:
Refused to load the script 'https://maps.googleapis.com/maps/api/js?libraries=places' because it violates the following Content Security Policy directive: "script-src 'self' https://maps.googleapis.com/* 'unsafe-inline' 'unsafe-eval'".
Refused to load the script 'https://test.firebaseio.com/.lp?start=t&ser=79549912&cb=1&v=5' because it violates the following Content Security Policy directive: "script-src 'self' https://maps.googleapis.com/* 'unsafe-inline' 'unsafe-eval'".
任何想法我做錯了什麼?
試圖'的「https://maps.googleapis。 com/*''而不是'https:// maps.googleapis.com/*' – Sushant
@Sushant,nope。我得到'內容安全策略指令'script-src'的源列表包含一個無效的來源:''https://maps.googleapis.com/*''。它會被忽略。 ' – Patrioticcow
fwiw scheme:// host/*不是有效的CSP模式。 'https:// maps.googleapis.com'是你想要完成的。 – oreoshake