我有一个问题，一会儿在WordPress的可视化编辑器按钮停止工作. 代码编辑器被罚款, 和可视化编辑器按钮存在，但上点击它没有任何效果. 多摆弄身边后，我终于发现这是由我的内容安全策略打破!
One reason this was so difficult to diagnose is because I haven’t seen anyone else suggest CSP as the source of the problem, especially since I am using the “classic editor” plugin which most people seem to blame. The plugin, or wordpress itself, may be partly to blame as my CSP isn’t unreasonable, but clearly I needed to permit something else.
When I finally started digging through the console I found the following error (in Firefox): The page’s settings observed the loading of a resource at eval (“script-src”)
So to get this working I will have to enable “unsafe-eval” which is annoying because this makes a content security policy largely pointless.
As more and more people implement CSP this will become more of an issue for the wordpress and plugin devs to resolve to hopefully in the longer term solutions will become available. Until then I will see if there is a workaround by removing inline and eval code.
The best information and guide I have found so far is at Color Blind Programming
有你自己的一些想法? 下面放纵自己通过评论! 如果您想订阅，请使用菜单上的订阅链接右上方. 您还可以通过使用下面的链接社会分享这与你的朋友. 干杯.