From 24e8a2d97a52d6dcfb10bc35019fddfe3deb7dd2 Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Tue, 20 Oct 2020 23:52:31 +0000 Subject: [PATCH] fix(core): update --- ts/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/index.ts b/ts/index.ts index 88181b0..cd2cadf 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -63,7 +63,7 @@ export class CsWebclient { if (consentTuple.level === 'functional' || acceptedCookieLevels.includes(consentTuple.level)) { const scriptString = consentTuple.script as string; // tslint:disable-next-line: function-constructor - const tupleFunction = new Function(`return ${scriptString}`); + const tupleFunction = new Function(`return (${scriptString})()`); await tupleFunction(consentTuple.scriptExecutionDataArg); console.log (`Successfully executed ConsentTuple >>${consentTuple.name}<< -> ${consentTuple.description}`); }