Iam當前正在爲Chrome添加擴展程序。我的擴展應包含Google Maps API。如果我嘗試午飯我擴展我得到這個錯誤:Google Maps API與Chrome擴展程序策略衝突
Refused to load the script 'https://maps.google.com/?file=api&v=2.x&key=KEY&sensor=true&callback=initialize' because it violates the following Content Security Policy directive: "script-src 'self'".
- 我有鑰匙
- 我設置權限的API:
"permissions":"https://maps.google.com/*"
- 我改變了CSP一些時間。如果設置CSU到API的URL像上面我有這樣的事情:
Refused to load script because it because it violates the following Content Security Policy directive: "script-src 'self' https://maps.google.com/?file=api&".'
- 我試圖將參數設置爲
&sensor=true
&&callback=initialize
我也讀了很多老的請求至極的類似於我的情況下,但我沒有找到任何可能有用的東西。
我會很高興,如果有人可以幫助我,謝謝:)
如何使用V3代替V2。 –
@EmmanuelDelay我可以,但我想我會遇到同樣的問題 – jokey
自從2012年左右起,API v2已被棄用,任何對'v2'的請求都將真正使用v3,但功能可能有限。閱讀:https://developers.google.com/maps/documentation/javascript/v2tov3 – duncan