CSP blocks use of eval in JavaScript (Newspaper v12.7.1)

Posted in: Newspaper
Post count: 2

Message:
Hello,
I’m using Newspaper Theme v12.7.1 with all tagDiv plugins installed.
My server applies a strict Content Security Policy, and in the console I get this error:

Content Security Policy of your site blocks the use of “eval” in JavaScript

It seems that tagDiv Composer or related plugins are trying to use eval().
How can I configure my site or theme to work without requiring unsafe-eval?

Thanks in advance.

Post count: 35449

Hi,

Some parts of the tagDiv Composer (and certain plugin scripts) rely on eval() for dynamic JS execution, which can trigger strict Content Security Policy (CSP) errors. Unfortunately, eval() is required by some of the builder’s features, so completely removing it isn’t fully supported out of the box.
Here is what you can try:
– Relax your CSP for development or trusted scripts: (allow unsafe-eval in your Content-Security-Policy for trusted scripts), or
– Limit Composer usage to pages/templates where live editing is needed.
Thank you!

Post count: 35449

Hi,

Some parts of the tagDiv Composer (and certain plugin scripts) rely on eval() for dynamic JS execution, which can trigger strict Content Security Policy (CSP) errors. Unfortunately, eval() is required by some of the builder’s features, so completely removing it isn’t fully supported out of the box.
Here is what you can try:
– Relax your CSP for development or trusted scripts: (allow unsafe-eval in your Content-Security-Policy for trusted scripts), or
– Limit Composer usage to pages/templates where live editing is needed.
Thank you!

Viewing 3 posts - 1 through 3 (of 3 total)
The forum ‘Newspaper’ is closed to new topics and replies.