当我试图用5.0.0以上(Lollipop时,我不断收到这些错误信息:
07-03 18:39:21.621: D/SystemWebChromeClient(9132): file:///android_asset/www/index.html: Line 0 : Refused to load the script http://xxxxx because it violates the following Content Security Policy directive: "script-src self unsafe-eval unsafe-inline ". 07-03 18:39:21.621: I/chromium(9132): [INFO:CONSOLE(0)] "Refused to load the script http://xxx because it violates the following Content Security Policy directive: "script-src self unsafe-eval unsafe-inline ".
然而,如果我用4.4.x(KitKat,则安保政策与缺省政策合作:
<meta http-equiv="Content-Security-Policy" content="default-src self data: gap: https://ssl.gstatic.com unsafe-inline unsafe-eval ; style-src self unsafe-inline ; media-src *">
我后来认为,或许应该改变这样的情况:
<meta http-equiv="Content-Security-Policy" content="script-src self unsafe-eval unsafe-inline ; object-src self ; style-src self unsafe-inline ; media-src *">
基本上,这两种选择都不对我工作。 我如何解决这一问题?