Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src * 'unsafe-inline'". | Community
Skip to main content
March 2, 2021
Question

Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src * 'unsafe-inline'".

  • March 2, 2021
  • 0 replies
  • 1938 views

Facing unsafe-eval error while using appmeasurement and plugin code to trigger the page view.

Can you provide a solution and correct me the script to use the script to get the page view.

 

 

Example : how to use the alternate solution of not using eval for this below one.

 

//Utility Function: vpr - set the variable vs with value v
s.vpr=new Function("vs","v","if(typeof(v)!='undefined' && vs){var s=this; eval('s.'+vs+'=\"'+v+'\"')}");

 

Thanks,

Santhosh.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.