diff --git a/ts/index.ts b/ts/index.ts index cd2cadf..3b0c221 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('dataArg',`return (${scriptString})(dataArg)`); await tupleFunction(consentTuple.scriptExecutionDataArg); console.log (`Successfully executed ConsentTuple >>${consentTuple.name}<< -> ${consentTuple.description}`); }