How to attach info to a new message chat?

We are trying to simulate a WebMessaging chat through tampermonkey but we are unable to use "Databese.set".

Follow below the script code that we are using:

(function (g, e, n, es, ys) {
g['.genesysJs'] = e;
g[e] = g[e] || function () {
(g[e].q = g[e].q || []).push(arguments)
};
g[e].t = 1 * new Date();
g[e].c = es;
ys = document.createElement('script'); ys.async = 1; ys.src = n; ys.charset = 'utf-8'; document.head.appendChild(ys);
setAtributo();
})(window, 'Genesys', 'https://apps.sae1.pure.cloud/genesys-bootstrap/genesys.min.js', {
environment: 'prod-sae1',
deploymentId: 'xxxx',
debug: true
});
/** Subscribe to Database.ready event before calling its command.**/
function setAtributo() {
// Set the data in the Database plugin. This data will automatically be included along when sending actual messages.
'Genesys'("command", "Database.set", {
messaging: {
customAttributes: {
nome: "testing",
cpf: "534423"
}
}
})
};

We already see some similar question in another topic but the answer was not posted. Thank you.

We are getting the following error:

We also already add the meta tag:

var meta = document.createElement('meta');
meta.setAttribute('http-equiv','Content-Security-Policy');
meta.setAttribute('content','default-src 'self'; connect-src https://.nr-data.net https://shyrka-prod-sae1.s3.sa-east-1.amazonaws.com https://.newrelic.com https://.sae1.pure.cloud wss://.sae1.pure.cloud; script-src 'self' 'unsafe-inline' https://.nr-data.net https://.newrelic.com https://.sae1.pure.cloud; media-src 'self' https://.sae1.pure.cloud; object-src 'self' https://.sae1.pure.cloud; child-src 'self' https://.sae1.pure.cloud; img-src 'self' https://*.sae1.pure.cloud; style-src 'self' 'unsafe-inline';');
document.head.appendChild(meta);

Several websites (I would add, several well-designed websites with advanced security protection) enforce content security policies to prevent execution of unexpected or potentially harmful scripts on that page. With these websites you will need more advanced response header manipulation to inject also your pure.cloud domain into CSP headers provided back to your browser. There are some Chrome & Firefox extensions for that, like ModHeader.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.