-
Notifications
You must be signed in to change notification settings - Fork 58
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
Does not work with strict Content Security Policy (CSP) that blocks unsafe-eval (new Function) #131
Comments
I'm facing the same issue. Any updates on this? @luigi-rosso |
I have not seen an update to date. I'd be interested in at least taking a look or even stab at fixing it if someone would be able to point me to the actual source files that are compiled/transpiled into the code shown above. |
This is coming from generated code from the enscriptem library that compiles our underlying web assembly and JS-binding "glue" code. Seems to be a popular issue, as seen here. You might have luck with |
Thanks for the update and links to monitor this. The PR looks promising, and I'll try with |
Hey @localpcguy , we updated this runtime in |
Sorry it took so long to get back to this - confirmed that using |
Description
An error is thrown if used in an environment where a CSP does not allow
'unsafe-eval'
due to the use ofnew Function
in thecreateNamedFunction
method currently at line 693 of the published rive.lean.js file.The error looks like this (will be slightly different depending on your CSP and the browser viewed in:
Provide a Repro
This should be fairly simple to repro by adding the following CSP in the file that the Rive script is being used in (assuming the Rive script is self hosted, but update localhost to be the domain where the rive script is loaded from to allow it if not.)
Source
.riv
/.rev
fileIndividual RIV file is not relevant to this issue
Expected behavior
Expected that the Rive scripts do not try to use
eval
ornew Function
and work as expected without errors when used in an environment with a strict CSP that blocks the use of'unsafe-eval'
.Browser & Versions (please complete the following information)
Any browser that parses and reads Content Security Policies (any modern browser including Chromium based browsers, Firefox and Safari).
The text was updated successfully, but these errors were encountered: