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

'unsafe-eval' Error #58

Open
BenjaminHofstetter opened this issue Jun 5, 2022 · 0 comments
Open

'unsafe-eval' Error #58

BenjaminHofstetter opened this issue Jun 5, 2022 · 0 comments

Comments

@BenjaminHofstetter
Copy link

In short this line leads to a 'unsafe-eval' error when this code is used in a Chrome Browser Extension.

const b_is_node = (new Function(/* syntax: js */ `try {return this===global;}catch(e){return false;}`))();

With Manifest v2 it was possible to allow unsafe-eval with a Content Security Policy. But Manifest V3 doesn't allow this anymore and Manifest v2 will be removed in 2023.

Is it possible to change this line and avoid the new Function(xxx) and do something like ?

const b_is_node = (() => {try {return this===global;}catch(e){return false;}});
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