我有一个网页正在注入一个f5_cspm脚本,该脚本使用现时标记识别。
在页面中,我还有另一个脚本可以根据该随机数值设置此脚本的使用。
很遗憾,我在浏览器控制台中看到错误。
我将在下面发布一些页面,但是我不确定相关的内容,因此,如果需要更多信息,请告诉我。
正在设置安全策略:
cpsm脚本:
<script id="f5_cspm" nonce="iSEhvNsGAXkHj4T5u6VU1oBEU7qBrbA7"></script>
<script id="f5_cspm">(function(){var f5_cspm={f5_p:'FLDPMFDCIFBMEHADMAOHGNKOBBFOLMFOIMOKBJIFMJKBGMMKJICNMLPIANDANJEDAAIDEGIFLGCHEIKMAALCFPDKGHMOCCMLFIGFBOLKHIONEKNOLPJHLIPOGFMDPBCG',setCharAt:function(str,index,chr){if(index>str.length-1)return str;return str.substr(0,index)+chr+str.substr(index+1);},get_byte:function(str,i){var s=(i/16)|0;i=(i&15);s=s*32;return((str.charCodeAt(i+16+s)-65)<<4)|(str.charCodeAt(i+s)-65);},set_byte:function(str,i,b){var s=(i/16)|0;i=(i&15);s=s*32;str=f5_cspm.setCharAt(str,(i+16+s),String.fromCharCode((b>>4)+65));str=f5_cspm.setCharAt(str,(i+s),String.fromCharCode((b&15)+65));return str;},set_latency:function(str,latency){latency=latency&0xffff;str=f5_cspm.set_byte(str,32,(latency>>8));str=f5_cspm.set_byte(str,33,(latency&0xff));str=f5_cspm.set_byte(str,27,2);return str;},wait_perf_data:function(){try{var wp=window.performance.timing;if(wp.loadEventEnd>0){var res=wp.loadEventEnd-wp.navigationStart;if(res<60001){var cookie_val=f5_cspm.set_latency(f5_cspm.f5_p,res);window.document.cookie='f5avr1326886222aaaaaaaaaaaaaaaa='+encodeURIComponent(cookie_val)+';path=/';}
return;}}
catch(err){return;}
setTimeout(f5_cspm.wait_perf_data,100);return;},go:function(){var chunk=window.document.cookie.split(/\s*;\s*/);for(var i=0;i<chunk.length;++i){var pair=chunk[i].split(/\s*=\s*/);if(pair[0]=='f5_cspm'&&pair[1]=='1234')
{var d=new Date();d.setTime(d.getTime()-1000);window.document.cookie='f5_cspm=;expires='+d.toUTCString()+';path=/;';setTimeout(f5_cspm.wait_perf_data,100);}}}}
f5_cspm.go();}());</script>
最后,控制台中的错误:
Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'nonce-iSEhvNsGAXkHj4T5u6VU1oBEU7qBrbA7'". Note that 'unsafe-inline' is ignored if either a hash or nonce value is present in the source list.
我的问题很简单-如何解决此错误?