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

Using the new Function class in the output JS #2040

Open
Acorn221 opened this issue Apr 19, 2022 · 1 comment
Open

Using the new Function class in the output JS #2040

Acorn221 opened this issue Apr 19, 2022 · 1 comment

Comments

@Acorn221
Copy link

Hello everyone! I'm not too experienced with browserify, however I've recently been having a problem with the Chrome extensions manifest v3 which will take over manifest v2 in early 2023.

The problem is that browserify outputs the bundle with calls using the "new Function" class in javascript and that's no longer allowed with manifest v3. This could potentially mean that no one could use browserify when developing chrome extensions from what I can see.

nsfwJS uses browserify and that is used in a few chrome extensions to help remove or blur NSFW content, Here's the issue.

Could anyone help us out here? The goal would be to avoid using eval, new Function, or any other way of executing strings.
Thanks!

@ljharb
Copy link
Member

ljharb commented Apr 19, 2022

The problem is there’s a ton of functionality that requires syntax support, and the only way to have that and be compatible with older engines is to use Function (which, ftr, is completely safe, unlike direct eval).

It’s unfortunate that Chrome extensions are limiting this critical functionality; it indeed will mean that a lot of programs simply won’t work in that environment anymore.

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

No branches or pull requests

2 participants