-
Notifications
You must be signed in to change notification settings - Fork 435
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
Workaround for unsafe-eval not being in CSP Chrome? #1984
Comments
Another options would be |
Thanks! I'll give that a shot. It seems like a much better solution than having my users change TamperMonkey configuration. |
I tried this as an experiment:
But got:
Are you talking about using |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a script that uses
eval
by creating anew Function
with user provided input. I discovered it recently stopped working in Chrome, but still works in Firefox with TamperMonkey 5.0.1. Whenever I try to eval something I get this error:This could be for 3 reasons
I've tried a few things, but the only thing that worked was to use the
Disable Content-Security-Policy extension
which is less than ideal.Before I explore running my JavaScript on a server or some other workaround, could this be related to the changes made to support MV3? If so is there any way I can run eval on a page that doesn't have
unsafe-eval
in the CSP. Do I need to do some sort of weird iframe trick like this? https://medium.com/geekculture/how-to-use-eval-in-a-v3-chrome-extension-f21ca8c2160cExpected Behavior
It is possible to execute a function with user provided content
Actual Behavior
Specifications
Script
Go to any github page and look in the console to see the output.
The text was updated successfully, but these errors were encountered: