Debug code for executeScript_Sandbox

I’m trying to parse a string within a for loop, and I want to console.log the value inside, but I receive the error console is not defined; if I try to change form executeScript_Sandbox to executeScript I get the error Error in executeScript code: 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 'report-sample' 'sha256-6gLjSWp3GRKZCUFvRX5aGHtECD1wVRgJOJp7r0ZQjV0=' static.licdn.com static-exp1.licdn.com static-exp2.licdn.com static-exp3.licdn.com www.linkedin.com/sc/ www.linkedin.com/scds/ www.linkedin.com/voyager/abp-detection.js piwik.corp.linkedin.com/piwik/piwik.js platform.linkedin.com/js/analytics.js platform-akam.linkedin.com/js/analytics.js platform-ecst.linkedin.com/js/analytics.js platform-azur.linkedin.com/js/analytics.js platform.linkedin.com/litms/utag/ platform-akam.linkedin.com/litms/utag/ platform-ecst.linkedin.com/litms/utag/ platform-azur.linkedin.com/litms/utag/ platform.linkedin.com/litms/vendor/ platform-akam.linkedin.com/litms/vendor/ platform-ecst.linkedin.com/litms/vendor/ platform-azur.linkedin.com/litms/vendor/ www.googletagmanager.com/gtag/js snap.licdn.com/li.lms-analytics/ merchantpool1.linkedin.com/mdt.js".

There is a way to debug the code, for example an “echo” function?

Hi, the unsafe-eval error sounds more like a executeScript error triggered by some websites instead of an executeScript _Sandbox error.

Are you really using executeScript _Sandbox? If so, can you please post the full command here?

This is my command:

{
      "Command": "executeScript_Sandbox",
      "Target": "var sourceInfo = ${infos};\nvar newInfo = \"\";\nvar infoArray = sourceInfo.split('.');\nfor (i =0; i < infoArray.length; i++ ) {\n\tvar info = infoArray[i];\n\tconsole.log(info.split(':')[1])\n\tnewInfo += (info.split(':')[1]).trim() +  \" \";\n}\nreturn newinfo;",
      "Value": "newInfo",
      "Description": "parse location and job type"
}

the ${infos} value could be “In sede\nCorrisponde alle tue preferenze per le offerte di lavoro: il tipo di luogo di lavoro è In sede.\n A tempo pieno\nCorrisponde alle tue preferenze per le offerte di lavoro: il tipo di offerta è A tempo pieno.”.
I know that the JS code has an error.

Also the executeScript _Sandbox error is:

The executeScript error happens when I try to switch from sandbox execution to the normal execution