Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running synaptic on a website (browser) that restricts 'unsafe-eval' with CSP #345

Open
adi-darachi opened this issue Jan 7, 2020 · 0 comments

Comments

@adi-darachi
Copy link

I'm using synaptic in a third-party product on the client side (basically a our code is being injected to our client's website).

We encountered an issue with a website that uses CSP (Content-Security-Policy) and does not allow 'unsafe-eval'.
Eval includes all method of executing string through javascript code:

  1. eval('var x = 1');
  2. new Function('var x = 1');

It seems that the library is using 'new Function' in couple of places.
After further investigation I realized that this code can be refactored to not use 'new Function' but native code.

I can help fixing this issue, I just want to know if there is a "real" reason for using this method rather than an actual code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant