You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is the code I am using, I need to replace the value of nonce attribute i.e CHAT_NONCE at run time.
mode: [
"inject",
{
container: "head",
singleTag: true,
attributes: {
chatLibrary: "chatLibraryNonce",
nonce: "**CHAT_NONCE**",
},
},
],
}),```
What I want to do:
``` styles({
mode: [
"inject",
{
container: "head",
singleTag: true,
attributes: {
chatLibrary: "chatLibraryNonce",
nonce: document.head.querySelector("[property~=csp-nonce]")?.content,
},
},
],
}),```
in above code I am putting the value by accessing a DOM element ie. meta tag. In Meta tag nonce values is being added by server side.
``` <meta property="csp-nonce" content="**CSP_NONCE**" /> ```
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Here is the code I am using, I need to replace the value of nonce attribute i.e CHAT_NONCE at run time.
Beta Was this translation helpful? Give feedback.
All reactions