我正在尝试使用manifest.json中定义的以下CSP在我的chrome扩展中加载google地图
"content_security_policy": "script-src 'self' 'unsafe-eval' https://maps.googleapis.com/ https://ssl.google-analytics.com; object-src 'self'"它工作得很好,现在我将我的扩展转换为Microsoft edge扩展。除了内容安全策略屏蔽google地图下载的资源外,整个代码都可以正常工作。下面是错误。如果我做错了,有人能纠正我吗?
CSP14312: Resource violated directive ‘script-src 'self'’ in Host Defined Policy: https://maps.googleapis.com/maps/api/js?key=ID. Resource will be blocked.错误代码找不到任何有用的资源。
发布于 2017-03-17 14:23:44
直到现在,我还没有找到正确的解决方案。但是,我发现了另一种将google地图集成到Microsoft Edge扩展中的方法。将iframe嵌入到扩展中。
<iframe width="100%" height="100%" frameborder="0" style="border:0"src="https://www.google.com/maps/embed/v1/place?q=40.7127837,-74.0059413&;key=ID"></iframe>https://stackoverflow.com/questions/42809330
复制相似问题