对于maps.googleapis.com的common.js文件,我在chrome开发者工具的控制台中多次收到以下错误
common.js:15
Refused to apply inline style because it violates the following Content Security Policy directive: "style-src 'self' https://fonts.googleapis.com https://s3.amazonaws.com https://maxcdn.bootstrapcdn.com". Either the 'unsafe-inline' keyword, a hash ('sha256-mmA4m52ZWPKWAzDvKQbF7Qhx9VHCZ2pcEdC0f9Xn/Po='), or a nonce ('nonce-...') is required to enable inline execution.
Run Code Online (Sandbox Code Playgroud)
我需要使用严格的 CSP 策略,因此不能使用 unsafe-inline 或 unsafe-eval 来放松策略。为了支持严格的 CSP 策略,不允许内联样式和脚本编写。似乎内联样式已在 google 地图 api 的 common.js 中使用,因此我收到上述错误。
security google-maps google-maps-api-3 inline-styles content-security-policy
当我在 docker 中运行强化任务的 python 代码时,它无法呈现。当我收到导入错误时,我尝试安装 GL,但它仍然给我同样的错误。有没有其他方法可以解决这个问题而不干扰包管理器?
错误信息:
/usr/local/lib/python3.7/site-packages/gym/logger.py:30: UserWarning: WARN: Box bound precision lowered by casting to float32
warnings.warn(colorize('%s: %s'%('WARN', msg % args), 'yellow'))
Episode 0
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/lbforaging/foraging/rendering.py", line 33, in <module>
from pyglet.gl import *
File "/usr/local/lib/python3.7/site-packages/pyglet/gl/__init__.py", line 95, in <module>
from pyglet.gl.lib import GLException
File "/usr/local/lib/python3.7/site-packages/pyglet/gl/lib.py", line 149, in <module>
from pyglet.gl.lib_glx import link_GL, link_GLU, link_GLX
File "/usr/local/lib/python3.7/site-packages/pyglet/gl/lib_glx.py", line 45, in <module>
gl_lib = pyglet.lib.load_library('GL')
File "/usr/local/lib/python3.7/site-packages/pyglet/lib.py", line 164, in load_library
raise ImportError('Library …Run Code Online (Sandbox Code Playgroud)