-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script #5028
Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script #5028
Comments
Can you provide a link to an example to reproduce? An example loading the library just fine: https://glitch.com/~aframe |
Yes sure. Adding the content security policy breaks it. Here is the code to reproduce: https://glitch.com/edit/#!/few-coherent-guilty?previewSize=0&attributionHidden=false&sidebarCollapsed=false&path=&previewFirst=false
After adding |
Do you need that meta tag? FWIW the |
Yes, I agree it seems safe. But this setting is global. So if we allow it, it will be allowed for the whole web app and makes the whole app security lower. After all it's called OTOH, since it's a simple use-case of adding getters, it should not be too hard to replace with something safer, right? Anyway, if you help me track that dependency I would be happy to try to fix the issue and create a PR. |
The quickest option is probably make and serve your own A-Frame build with the code corrected / removed. |
Thanks. I'll have a look and see what I can do. |
Hey @mattdesl Its been a while but has anyone updated this dependency on Jam3 side? Some providers just block content if there is an Cloudflare does it, and causes issues loading on web3 platforms. Here's an example with NFTStorage IPFS Gateway: https://bafybeidg3y34lewgcbarxgq4sayiwnl2lpb4smvxsic7cmzthv2rlov6de.ipfs.nftstorage.link/ And the same example with IPFS.IO Gateway: The NFTStorage one uses cloudflare, and they do not allow evals as they allow for malicious code to be injected on the client. |
Someone on slack had the same error trying to embed aframe into a chrome extension where unsafe-eval is forbidden. |
Description:
When loading the library, the browser throws an error:
Looking into the stack trace, I see these lines from https://github.com/aframevr/aframe/blob/master/dist/aframe-master.js
Looks like aframe requires unsafe-eval to be allowed which is quite dangerous. Is there a workaround to use aframe without enabling
unsafe-eval
??Can this be replaced by something safer? like:
Thanks!
The text was updated successfully, but these errors were encountered: